[Git] Common Usage
来源:互联网 发布:安畅网络水军平台 编辑:程序博客网 时间:2024/04/30 13:59
rebase
Before:
“This branch is 3 commits behind octantis:master.”
git fetch upstream
git rebase upstream/master
git push origin master
After:
“This branch is even with octantis:master.”
Screenshot:
Reference: Syncing a fork
Why rebasing?
Often, you’ll do this to make sure your commits apply cleanly on a remote branch – perhaps in a project to which you’re trying to contribute but that you don’t maintain. In this case, you’d do your work in a branch and then rebase your work onto origin/master when you were ready to submit your patches to the main project. That way, the maintainer doesn’t have to do any integration work – just a fast-forward or a clean apply.
Note that the snapshot pointed to by the final commit you end up with, whether it’s the last of the rebased commits for a rebase or the final merge commit after a merge, is the same snapshot – it’s only the history that is different. Rebasing replays changes from one line of work onto another in the order they were introduced, whereas merging takes the endpoints and merges them together.
References
(1) https://git-scm.com/about
- Git-Common-Usage
- [Git] Common Usage
- git usage
- git usage
- Perl common usage
- SQL common usage
- cmake common usage
- some common usage of robocopy
- Git Usage 图解
- SVN,GIT usage
- git usage related
- Git diff usage
- git usage and configuration
- git usage summary
- GIT command usage
- Git Common Command
- Git common commands summary
- git common commands
- MFC程序重启
- IP TCP以及HTTP报文gesh
- 保存bitmap为文件的方法
- linux 进程总结
- 链式的队列的创建、插入、删除、遍历、取队首元素
- [Git] Common Usage
- WindowManager悬浮框1
- An internal error occurred during:launching on Tomcat. java.lang.NullPointerException
- Lucene用法10个小结
- 221. Maximal Square
- 关于新浪微博授权错误:文件不存在c8998
- 最长无重复字符子串长度_M
- cartogapher 源码分析 (transform)
- 过滤掉List<HashMap<String,Object>>中键值相同的数据!