1

git fork下的项目管理

 2 years ago
source link: https://cfonheart.github.io/2019/02/20/git-fork%E4%B8%8B%E7%9A%84%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

git fork下的项目管理

2019-02-20

我们协助他人进行合作开发的时候,往往是fork他人的项目,而不是直接在原项目基础上创建分支,在自己fork的项目下进行修改后,提交merge request。

fork的项目并不会自动随着源项目的修改而修改,所以我们每次修改一个项目之前,都要重新拉取原项目,将原项目他人做的修改合并过来。

原项目git源: ssh_old

现在项目的git源: ssh_now

1. git clone ssh_now
2. 查看现在的项目源
git remote -v
3. 添加原项目的源,名字定为upstream
git remote add upstream ssh_old
git remote -v
4. 每次对这个项目修改之前,都要去merge他人的修改
git fetch upstream
git merge upstream/master

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK