简体   繁体   English

单独的git pull请求与不同的分支| 如何git推送分支

[英]separate git pull requests with different branches | How to git push a branch

I forked and cloned a repo to my local machine: 我分叉并克隆了一个回购到本地计算机:

/sample_app

I want to submit 3 different pull requests to the original repo. 我想向原始存储库提交3个不同的请求请求。 As far as I can tell the way to do this is to create seperate pull requests from separate branches? 据我所知,这样做是从单独的分支创建单独的拉取请求? I am confused as to the sequence of commands here. 我对这里的命令顺序感到困惑。

I ran: 我跑了:

git checkout -b firstbranch
made changes... made changes..
git add .
git commit -m "finished first feature"

However when I run: 但是当我运行时:

git push

I get: 我得到:

Everything up-to-date

despite the fact that I just made a bunch of changes on my new branch(I can verify I am on new branch). 尽管我刚刚在新分支上做了很多更改(我可以验证自己在新分支上)。

Am i supposed to run something other than git push ? 我是否应该运行除git push之外的其他东西? On my forked repo I still only see 1 master branch and no other branches. 在我的分叉仓库中,我仍然只看到1个主分支,没有其他分支。

After I push it from what I gather I would need to click on the pull request button and select that branch to submit through the pull request correct? 从收集到的信息中推送之后,我需要单击“拉取请求”按钮并选择该分支以通过拉取请求正确提交?

Then I can go to my command line and do: 然后,我可以转到命令行并执行以下操作:

git checkout master
git checkout -b Secondbranch  ##To create a second branch for second feature

and repeat the process, etc 并重复该过程等

Am i getting this right? 我说对了吗?

How do I push my branch so that I can then create a branch specific pull request. 如何推送分支,以便随后可以创建分支特定的拉取请求。 Not merging it with main branch. 不将其与主分支合并。

Your process is right. 您的过程是正确的。 You just need to do: 您只需要做:

git push  <REMOTENAME> <BRANCHNAME> 

See here 这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM