Initialing
$ git init
if exits
$ git status
Add
$ git add
Commit
$ git commit -m ""
History
$ git log
$ git log --oneline
Help
$ git help --all
$ git --help
Branch ()
$ git branch
What is it?
merge juncao
Creating new branch
$ git branch
or
$ git switch -c
Go to other version
$ git switch
$ git push --set-upstream origin
-
Already on branch master
Using Merge
$ git merge
Deleting branch
$ git branch -d
Git ignore
creating file
.gitignore
indicate files or folders that I want git not to put in the repository
Correcting commit message
$ git log --oneline (see)
$ git commit --amend -m ""
WARNING!!
$ git revert HEAD( or HASH) --no-edit (or -m " new message")
$ git revert HEAD --no-edit
Return commit
$ git stash