在公司使用git,一般会要求,fork部门的仓库,而不允许直接clone部门仓库到本地。

先fork部门仓库到个人名下,再clone个人名下的仓库。

使用如下操作:

git clone -b dev (个人远程仓库地址)
git remote add upstream (部门仓库地址)
git remote -v (查看远程仓库地址)
git fetch upstream (同步upstream仓库)
git checkout dev (切换到dev分支)
git merge upstream/dev(合并upstream的dev分支到本地仓库)
git push (推送到origin分支)
修改代码
git add .
git commit
git push (推送到origin分支)
在个人分支添加PR到部门分支
SE审核并合并代码

相关文章:

  • 2021-07-18
  • 2022-02-08
  • 2022-12-23
  • 2022-12-23
  • 2021-05-11
  • 2021-09-02
  • 2022-02-07
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-26
  • 2022-12-23
  • 2021-10-08
  • 2021-04-12
  • 2021-12-12
  • 2021-12-01
相关资源
相似解决方案