github新建repositories后import已有code 随后同步更新

github上,可以forks别人已有的项目,而且同步更新合并也很方便,但如果是自己新建的项目,而导入的是别人的代码修改后,别人的又更新了,自己想获取他的更新,怎么办呢?其实很简单。

#1 git clone 自己新建的项目到本地,例如新建了一个suda_android:
git clone https://github.com/DinphyMod/suda_android.git

#2 进入克隆下来的本地项目里
cd suda_android

#3 由于是import别人的代码,想要同步更新原有的项目android:
git pull https://github.com/SudaMod/android.git

#4 合并,按提示操作,一般直接Ctrl + X 就可以了

#5 将本地合并的上传到github上
git push origin master 
原文地址:https://www.cnblogs.com/dinphy/p/6665331.html