码迷,mamicode.com
首页 > 其他好文 > 详细

从Git Fork的项目怎么更新?

时间:2015-05-18 22:29:38      阅读:121      评论:0      收藏:0      [点我收藏+]

标签:

原文:https://robots.thoughtbot.com/keeping-a-github-fork-updated

 

I forked a GitHub repo thoughtbot/dotfiles to croaky/dotfiles and want to keep it updated.

Track

+

After I forked the repo to your Github account, I did this one time:

+
git clone git@github.com:croaky/dotfiles.git
cd dotfiles
git remote add upstream git@github.com:thoughtbot/dotfiles.git

 

Update

+

Each time I want to update, from my local master branch:

 
git fetch upstream
git rebase upstream/master

 

1

The goal of the rebase is to have a cleaner history if I have local changes or commits on the repo. It’s the difference between the the left and the right in the image below.

+

技术分享

Commit rights upstream

+

If I also have commit rights to the upstream repo, I can create a local upstream branch and do work that will go upstream there.

+
git checkout -b upstream upstream/master

 

从Git Fork的项目怎么更新?

标签:

原文地址:http://www.cnblogs.com/wuyahuang/p/4512960.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!