How to update GitHub forked repository
来源:互联网 发布:网络推广课程培训班 编辑:程序博客网 时间:2024/06/06 01:04
In your local clone of your forked repository, you can add the original GitHub repository as a "remote". ("Remotes" are like nicknames for the URLs of repositories - origin
is one, for example.) Then you can fetch all the branches from that upstream repository, and rebase your work to continue working on the upstream version. In terms of commands that might look like:
# Add the remote, call it "upstream":
git remote add upstream git://github.com/whoever/whatever.git
# Fetch all the branches of that remote into remote-tracking branches,
# such as upstream/master:
git fetch upstream
# Make sure that you're on your master branch:
git checkout master# Rewrite your master branch so that any commits of yours that# aren't already in upstream/master are replayed on top of that# other branch:git rebase upstream/master
If you don't want to rewrite the history of your master branch, (for example because other people may have cloned it) then you should replace the last command with git merge upstream/master
. However, for making further pull requests that are as clean as possible, it's probably better to rebase.
Update: If you've rebased your branch onto upstream/master
you may need to force the push in order to push it to your own forked repository on GitHub. You'd do that with:
git push -f origin master
You only need to use the -f
the first time after you've rebased.
转载地址:http://stackoverflow.com/questions/7244321/how-to-update-github-forked-repository
- How to update GitHub forked repository
- How to update GitHub forked repository?
- How to update a Github forked repository
- How to create folder in github repository?
- git如何merge github forked repository里的代码更新?
- git如何merge github forked repository里的代码更新?
- git如何merge github forked repository里的代码更新?
- git如何merge github forked repository里的代码更新?
- How to avoid relying on github: mirror your repository
- Github删除forked项目
- how to remote push repository to github--解决403forbidden和publickey问题
- How to create a maven repository for your github project step by step
- how to update codelite
- how to update ruby
- How to update things
- Github how to use
- How to use github
- How to Host a Cydia™ Repository
- android copybit的应用
- 部署windows服务
- 工厂方法模式(Factory Method)
- 学习的第四天(xcode4.2的一些新特性)
- (三) 搭建cocos2d-x-android环境 Windows XP3 + Eclipse + NDKR7(或ndkr7b)+COCOS2DX(没有用到cygwin和minigw)
- How to update GitHub forked repository
- GDI入门实例(在VC++6.0中将JPG格式图片转换成BMP格式)
- IFrame
- expr命令
- 解决on_chip_memory过小的问题,Niosii编译出现问题
- 父窗体与浮动帧之间的相互控制
- 实例入侵网站数据库
- 无限级树形菜单
- 睡是千金