Git extrascheatsheet
git-extras 的一些参考命令
贡献者:BAI
参考
Git-flow
SH$ git feature myfeature switched to branch 'feature/rofl'$ git checkout develop$ git feature finish myfeature merging 'feature/rofl' into develop deleted branch 'feature/rofl'
同样可以用 git-bug
和 git-refactor
.
Branch
SHgit delete-merged-branches# 之后可以执行 `git remote prune origin` 来删除掉远端分支git create-branch developmentgit delete-branch developmentgit fresh-branch gh-pages
查看一些信息
SHgit summary # 代码仓库的创建时间、提交记录、活跃天数等等git impact # 影响图表git effort
Github
SHgit fork strongloop/express# 同步你的 Fork 和原始的 Repo 一致git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.gitgit fetch upstream; git merge upstream/master
Tag
SHgit release v1.0.0 # commit, tag, push-tagsgit delete-tag v1.0.0
git ignore
SHgit ignore "*.log"
git lock
设置这个改变不会被提交
SHgit lock config/database.ymlgit unlock config/database.yml
其他
SHgit obliterate secret.yml # remove all references to it