Git Command(Section 2)

Now we could learn more about git.

Advanced reference

Clone a repository into a new directory

1
$ git clone git@github.com:xuxin0612/pythonLearning.git my-pythonLearning

Switch branches

1
$ git checkout -b dev

List branches

1
$ git branch -a

Create branches

1
$ git branch dev

Delete branches

1
$ git branch -d dev

Merge the branch into the current branch

1
$ git merge —-no-ff -m “merge with no-ff” dev

Push the branch into the remote repository

1
$ git push origin dev:dev

Config the username and email of git

1
2
$ git config user.name “scott”
$ git config user.email “xuxin0612@gmail.com”

Pull the newest changes into the current banch

1
$ git pull

Build a tag

1
$ git tag v1.0

Look at all the tags

1
$ git tag v1.0

Delete the tag

1
$ git tag -d v1.0

Push the tag into the remote repository

1
$ git push origin v1.0