I am setting up a workflow for a team of people. There will be a main repo, and the people will be instructed to fork the repo on github, then clone it to their local machines. The process for submitting code updates will look pretty much like this:
- git checkout -b feature_branch # and do some work on the branch
After time has passed, I would like to have the people make sure that their copy of master is up to date, and ask them to do this:
- git commit feature_branch # to save the work they did so as not to lose it (instead of git stash)
- git fetch upstream
- git checkout master
- git merge upstream/master
- git push origin master
Questions:
How should the person then update their feature_branch with the new information, since the copy of master they forked from changed?
Is it to use git diff to see the differences between their feature branch and the new master branch and adjust their feature branch manually? Or is it to have them create a new branch off of the new master and copy and paste code from their old branch to their new branch?
Either process seems a bit clumsy/manual, but I cannot see any other way.
I have found answers that confirm the general process but do not discuss best practices of the process of updating the feature branch.
Thanks.