Do you not need to synchronize the changes of the original repository after the modification?
Am I direct when syncing
pull
? How to resolve conflicts that do not allow pull? (Of course you canfetch
domerge
anything else)
I think the more correct way to open:
fork
original warehouseclone
own warehouseAdd the original repository to the
master
branch as a remote branchgit remote add upstream 远程仓库
Branch development by yourself, such as
dev
branch development:git checkout -b dev
local
dev
commitswitch
master
branch, sync original repository:git checkout master
,git pull upstream master
Switch the local
dev
branch, merge the localmaster
branch (already synchronized with the original repository), may need to resolve the conflictSubmit your local
dev
branch to your own remotedev
repositoryNow it's time to make a
pull request
request to the original repositoryWait for the original author to reply (accept/reject
For a project that has been forked, after the source is updated, we must re-fork to get the latest version?
step:
1. Add the remote source of the upstream code base in the code base of the fork. This operation only needs to be done once.
Such as: where # upstream represents the name of the upstream code base, which can be arbitrary.
git remote add upstream https://github.scm.corp.ebay.com/montage/frontend-ui-workspace
2. Submit the local changes to commit
3. Do the following before each Pull Request to synchronize with the upstream repository.
3.1 : git remote update upstream
3.2 : git rebase upstream/{branch name}
需要注意的是在操作3.2之前,一定要将checkout到{branch name}所指定的branch,
如: git checkout develop
4. Push 代码到 Github
转处:https://blog.csdn.net/lupeng0206/article/details/72828080