解决fork分支更新代码

场景:

fork分支后,源分支更新了新的代码,而fork分支没有同步更新。

 

解决:

# 1.查看当前分支情况
> git remote -v

origin  https://github.com/bboyHan/openstack4j.git (fetch)
origin  https://github.com/bboyHan/openstack4j.git (push)

# 2.添加source
> git remote add source https://github.com/openstack4j/openstack4j.git

# 3.再次查看
> git remote -v

origin  https://github.com/bboyHan/openstack4j.git (fetch)
origin  https://github.com/bboyHan/openstack4j.git (push)
source  https://github.com/openstack4j/openstack4j.git (fetch)
source  https://github.com/openstack4j/openstack4j.git (push)

# 4.拉remote分支代码
>git fetch source

# 5.merge远程分支代码
> git merge source/master

# 6.合代码
> git push origin master

 

 

你可能感兴趣的:(Java)