常用Git命令和配置
2012-08-24 16:18
363 查看
常用配置:
[color] ui = auto[user] name = Mark Zhang email = super119@139.com[core] editor = vim[diff] tool = vimdiff renames = true[difftool] prompt = No[format] headers = X-NVConfidentiality: public[sendemail] chainreplyto = false smtpserver = xxxxxxxx smtpencryption = tls from = Mark Zhang <super119@139.com> envelopesender = auto[alias] s = status cp = cherry-pick ck = checkout b = branch lo = log --oneline
常用命令:
git remote add <name> <url>
git fetch --all/git fetch origin
git status
git log --oneline
git show <commit id>
git commit --amend
git push origin HEAD:next -- push local branch(the branch which HEAD resides) to remote branch named "next".
git push origin +HEAD:next -- push local branch(the branch which HEAD resides) to remote branch named "next", regardless if local & remote has diverge(fast-forward doesn't work).
In short words, use local branch overwrite the remote branch. Refer to git help push for details(the last example).
git push origin :next -- remove remote branch named "next".
git format-patch -<N>
git format-patch --subject-prefix 'PATCH V2' --cover-letter
git send-email --to=XXX --to=XXX --cc=XXX *.patch
git send-email --no-signed-off-cc --to=XXX --to=XXX --cc=XXX *.patch
git rebase -i <commit id>
git branch -av
git branch -d/git branch -D
git rebase --onto next master feature -- rebase the patch set from master to feature into next
Original:master \_______featurenextNow:masternext \________featureThis is helpful when you want you patches apply on another branch.
git checkout <branch> -- <file path>
-- This can be used to checkout a specific file in a specific branch, update the corresponding file in current working tree
git show <branch>:<file path> >& <filename>
-- This can be used to checkout a specific file in a specific branch, but save in custom file while not updating the file in working tree
git push --tags
-- Push local tags into remote repo.
[color] ui = auto[user] name = Mark Zhang email = super119@139.com[core] editor = vim[diff] tool = vimdiff renames = true[difftool] prompt = No[format] headers = X-NVConfidentiality: public[sendemail] chainreplyto = false smtpserver = xxxxxxxx smtpencryption = tls from = Mark Zhang <super119@139.com> envelopesender = auto[alias] s = status cp = cherry-pick ck = checkout b = branch lo = log --oneline
常用命令:
git remote add <name> <url>
git fetch --all/git fetch origin
git status
git log --oneline
git show <commit id>
git commit --amend
git push origin HEAD:next -- push local branch(the branch which HEAD resides) to remote branch named "next".
git push origin +HEAD:next -- push local branch(the branch which HEAD resides) to remote branch named "next", regardless if local & remote has diverge(fast-forward doesn't work).
In short words, use local branch overwrite the remote branch. Refer to git help push for details(the last example).
git push origin :next -- remove remote branch named "next".
git format-patch -<N>
git format-patch --subject-prefix 'PATCH V2' --cover-letter
git send-email --to=XXX --to=XXX --cc=XXX *.patch
git send-email --no-signed-off-cc --to=XXX --to=XXX --cc=XXX *.patch
git rebase -i <commit id>
git branch -av
git branch -d/git branch -D
git rebase --onto next master feature -- rebase the patch set from master to feature into next
Original:master \_______featurenextNow:masternext \________featureThis is helpful when you want you patches apply on another branch.
git checkout <branch> -- <file path>
-- This can be used to checkout a specific file in a specific branch, update the corresponding file in current working tree
git show <branch>:<file path> >& <filename>
-- This can be used to checkout a specific file in a specific branch, but save in custom file while not updating the file in working tree
git push --tags
-- Push local tags into remote repo.
相关文章推荐
- git配置及常用命令
- Git常用命令及公钥配置
- GIT配置及常用命令
- git配置、绑定、提交、修改相关常用命令行
- git配置及常用命令
- git安装配置,常用命令
- GIT常用命令--用户配置
- Git安装完后的配置及常用操作命令
- Git常用命令和配置
- git常用命令--安装配置
- Git配置和一些常用命令
- git 一些配置及常用命令
- git简单配置和常用命令
- Git配置和常用命令
- nginx配置多站点+git常用命令
- Git 使用的配置 常用命令
- git配置和常用命令
- Mac下配置git环境和客户端SourceTree+Git常用命令大全(Mac 10.12)
- git配置和常用命令
- git ssh配置以及常用上传命令