The use of Git and Bitbucket

1. Create a directory to contain your repos:

   mkdir repo(the name of your repository)
2. Switch to repo. Clone your repository:
   git clone https://[email protected]/username/repo.git(the name of your repository)
....................................................................................................................................................
   A series of operations in your repo directory.
....................................................................................................................................................
3. git status 
   The command tells you about how your project is progressing in comparison to your Bitbucket repo.
4. Add the new file to a pending commit.
   git add filename
5. Commit all the changes you added.
   git commit -m "..............."
6. Push your committed changes back to your Bitbucket repository.
   git push -u origin master
......................................................................................................................
 
新建分支:git branch abc(分支名)
查看分支:git branch
带*为当前分支
切换分支:git checkout abc

在分支abc中进行更新并确认无误后,可与master分支合并,如下:
先切换到master分支:git checkout master
然后将abc分支与当前分支合并:git merge abc

删除一个分支:git branch -d abc
-d只能删除已经参与了合并的分支,如果想删除为何master合并的分支可以用-D

你可能感兴趣的:(git)