I am quiet new to git and github. I have a team of 4 working on a project and have set up a remote repo in github. We have been pushing to the master branch for several weeks now. I want to know how to push to a test branch and later after reviewing merge it to the master when finalized. Can someone help?
I have tried creating a test branch and merging it with the master and it messed up the whole history. It says the master is behind the test by 'n' commits and this doesn't seem right.
First, from the command line, make sure your master branch is up-to-date locally:
git checkout master
Create a new local branch named feature/test
:
git checkout -b feature/test
Make changes to some files.
Tell Git to track the changes you made to your files - repeat this step to add all of the changed files:
git add (path to file that was changed)
Create a commit with all your changes:
git commit -m "a message about your commit"
Push this set of changes to a feature/test
branch on your team Github:
git push origin feature/test
Pull Requests
tab, click New pull request
. Choose master
as the Base branch and feature/test
as the Compare branch, then click Create pull request
.master
branch.