如何PR到别人仓库(指定分支,无废话)

如何PR到别人仓库(指定分支)

记录一下,之前都是直接master分支,现在记录如何pr到别人仓库的其他分支

首先进入别人仓库然后点击fork到自己仓库

步骤(以博主自己一个例子为例)

(1)拉取你fork到你仓库

git clone https://github.com/dragonforward/MaixCDK.git

(2)添加原始仓库(也就是你fork的仓库)作为上游(upstream):

git remote add upstream https://github.com/sipeed/MaixCDK.git

(3)切换到你想要的分支(例如我fork的仓库是master分支和dev分支,fork后默认为master分支)

git checkout -b dev upstream/dev

这样你就可以拉取切换并创建一个dev分支并和原始仓库的dev分支

(4)添加你的修改然后commit

git add app_audio
git commit -m "app_audio_source_code"
git push origin dev

然后你得仓库界面就会显示,点击按钮创建pull request然后就ok了

博主的整个history过程

  490  git clone https://github.com/dragonforward/MaixCDK.git
  491  cd MaixCDK/
  492  LLS
  493  ls
  494  git remote add upstream https://github.com/sipeed/MaixCDK.git
  495  git fetch upstream
  496  git branch -r
  497  git checkout -b dev upstream/dev
  498  git branch
  499  ls
  500  cd projects/
  501  ls
  502  git add app_audio
  503  git commit -m "app_audio_source_code"
  504  git push origin dev
  505  history
相关推荐
威迪斯特2 个月前
Mysql存储过程用法:使用存储过程编程,来判断数据库中数据表中的字段是否重复,避免重复插入记录
linux·数据库·mysql·编程·存储过程·记录·重复
Liu_某4 个月前
记录一些常用的网站
记录
小白探索世界欧耶!~1 年前
Ajax基础笔记
前端·javascript·经验分享·笔记·ajax·okhttp·记录