Home >Development Tools >git >The most detailed Git operation commands are here!
Today this column introduces Git operation commands. Friends who need to take a look are welcome to leave a message for discussion.
git init
git init [project-name]
git clone [url]
Git’s setting file is .gitconfig, which can be in the user’s home directory (global configuration) or in the project directory (project configuration).
git config --list
git config -e [--global]
git config [--global] user.name "[name]"git config [--global] user.email "[email address]"
git add [file1] [file2] ...
git add [dir]
git add .
git add -p
git rm [file1] [file2] ...
git rm --cached [file]
git mv [file-original] [file-renamed]
git commit -m [message]
git commit [file1] [file2] ... -m [message]
git commit -a
git commit -v
git commit --amend -m [message]
git commit --amend [file1] [file2] ...
git branch
git branch -r
git branch -a
git branch [branch-name]
git checkout -b [branch]
git branch [branch] [commit]
git branch --track [branch] [remote-branch]
git checkout [branch-name]
git checkout -
git branch --set-upstream [branch] [remote-branch]
git merge [branch]
git cherry-pick [commit]
git branch -d [branch-name]
git push origin --delete [branch-name]git branch -dr [remote/branch]
git tag
git tag [tag]
git tag [tag] [commit]
git tag -d [tag]
git push origin :refs/tags/[tagName]
git show [tag]
git push [remote] [tag]
git push [remote] --tags
git checkout -b [branch] [tag]
git status
git log
git log --stat
git log -S [keyword]
git log [tag] HEAD --pretty=format:%s
git log [tag] HEAD --grep feature
git log --follow [file]git whatchanged [file]
git log -p [file]
git log -5 --pretty --oneline
git shortlog -sn
git blame [file]
git diff
git diff --cached [file]
git diff HEAD
git diff [first-branch]...[second-branch]
git diff --shortstat "@{0 day ago}"
git show [commit]
git show --name-only [commit]
git show [commit]:[filename]
git reflog
git fetch [remote]
git remote -v
git remote show [remote]
git remote add [shortname] [url]
git pull [remote] [branch]
git push [remote] [branch]
git push [remote] --force
git push [remote] --all
git checkout [file]
git checkout [commit] [file]
git checkout .
git reset [file]
git reset --hard
git reset [commit]
git reset --hard [commit]
git reset --keep [commit]
git revert [commit]
git stash git stash pop
git archive
推荐学习:《Git教程》
The above is the detailed content of The most detailed Git operation commands are here!. For more information, please follow other related articles on the PHP Chinese website!