Open tojaroslaw opened 5 years ago
As an added bonus, if you put 'resolves #<issue_number>'
or 'fixes #<issue_number'
in the commit message, it will automatically close the issue when you push that commit to master
Steps 6 and 7 are not strictly necessary, from inside your local branch, you can just run git push origin master
once you've fixed the merge conflicts and committed the changes. Just remember to pull in the master branch next time you check it out to see that your changes were pushed. Steps 6 and 7 simply exist to reduce confusion later on.
If you want to make a change, make a new local branch. Make sure that your git bash is in the Gold-Team directory.
git checkout -b <branch_name>
This will create a new local branch with all of the code from the branch you are currently on. If you want to make changes to the code, remember to commit those changes using the command:
git commit -am '<commit_message>'
If you are ready to push those changes, but don't want to merge your code with master yet, push your code to a remote branch.
git push origin <branch_name>
This branch can now be checked out by the entire team. If you are ready to push to master, commit your changes to your local branch, then follow these steps:
Commit your changes
git commit -am '<commit_message>'
Switch to the master branch
git checkout master
Pull from master
git pull
(if this doesn't work try this)git pull origin master
Switch back to your local branch (some of these steps are redundant, but it reduces the likelihood of problems)
git checkout <branch_name>
Merge the two branches
git merge master
You may have to fix merge conflicts. You will see a list of files that need to be merged. When you are done fixing the merge conflicts, commit your work again:git commit -am '<commit_message>'
If there are no conflicts, then you do not need to commit again.Switch back to master
git checkout master
Merge from your local branch
git merge <branch_name>
Push the changes
git push
orgit push origin master
Try not to make changes directly in the
master
branch. Instead try to make separate branches for changes that you are making. Only push working commits to master.