Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 2
Message 1 of 2

state of being up to date after accepting a pull-request and branches

Solved! Go to Solution.

Hello,

 

on a new github project I created 2 new branches next to master - "contrib" which is meant for contributions of other people and "remote" that is accepting my changes from at home. But when people fork master, do changes and send a pull-request it will end up in master, right? Or will there be a way to select in which branch the changes go? And lets say I merged everything into master will the other two branches be up to date automatically?

 

Thanks in advance,

P.

1 Reply
Solution
Community Manager
Message 2 of 2

Re: state of being up to date after accepting a pull-request and branches

Hi @cleymspaze,

 

Thank you for being here!  You can tell git when you want to checkout the branch with:

 

git checkout <name>

This will put you on the new branch before committing changes. With GitHub, you can deploy from a branch for final testing in production before merging to master. Also, publish your changes to the remote by using "git push" from time to time.

 

For instance your workflow may look something like this: 

 

  1. Create a private branch (remote) off a public branch, in your case the contrib branch.
  2. Regularly commit your work to this private branch.
  3. Once your code is perfect, clean up its history.
  4. Merge the cleaned-up branch back into the public branch.

 

I hope this helps! I look foward to other folk advise on best practice here. For us the GitHub flow is the norm.


Best,
AndreaG

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!