Level four mode
Workspace Staging Area local warehouse remote Warehouse
git config--global user.name "YourName"
git confit--global user.email "Youremail"
Git init
git Add File
Git commit-m "somecomments"
git status
git diff file to see the difference between the workspace and the local warehouse
git log--pretty=oneline
git reset--hard head^ (head~100)
git reset--hard 123456 (version number)
Git reflog
git diff HEAD--The difference between the latest version of file and the workspace
Git checkout--the same as file and workspace or repository can also be used to recover deleted errors
git reset HEAD file
git rm file deleted directly after commit
Ssh-keygen-t rsa-c "Youremail"
Git remote Add origin [email protected]:blueflag417/test1.git
Git push-u origin master pushes master and establishes contact (Git push Origin master)
git clone [email protected]:blueflag417/gitskills.git
Git branch
git branch dev + git checkout dev = git checkout-b dev
git merge Dev
git branch-d Dev
git log--graph--pretty=oneline--abbrev-commit (git log--graph)
git merch--no-ff-m "some comment" dev
Git stash
git stash apply + git stash drop = git stash pop
git stash apply [email protected]{0}
git stash List
git branch-d Dev forcibly delete branch
Git remote (-V)
git checkout-b Dev Origin/dev
Git pull
Git branch--set-upstream Dev origin/dev
git tag
git tag name
git tag name 123456
Git show name
git tag-a name-m "some Conmmont" 123456 (git tag-s name-m "some Conmmont" 123456)
git tag-d name
Git push origin name
Git push Origin--tags
git push origin:refs/tags/name
git config--global color.ui true
. gitignore
git config--global alias.st "status"
Common git commands