ttmt
ttmt

Reputation: 4984

GIT - Pushing from fork to upstream master

So I have forked a repo.

I would normally do fork, branch then create pull request from my fork.

Can I work in master I have locally then push to my fork and then push the master in my fork straight to the upstream master with

git push upstream master

Before I do this I would pull from upstream to make sure I was up to date

My origin is called upstream as well

Can I push master in my fork to master at upstream with

git push upstream master

Upvotes: 1

Views: 3417

Answers (1)

bimlas
bimlas

Reputation: 2597

If I understand yout question correctly, then you don't need and should not work to master directly: this is the purpose of the branches. Commit your modifications in to branches (one branch per purpose, even if it's contains a single commit), then send a pull request for each one. The owner of the original repository can fast forward your branches (to merge without merge commit) but it's his/her decision, not yours.


BTW it's funny that you can technically make a pull request on master but it's not a recomended way.

Upvotes: 1

Related Questions