You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 15, 2022. It is now read-only.
JoAnMontero edited this page Apr 7, 2015
·
2 revisions
First, we will see the necesary steps to develop in our own branch:
We create our new branch with:
git checkout -b newBranch
The -b options will automaticly switch us to the new branch.
We make some changes at some file.
We add the changes to a commit as we ussualy do:
git statusgit add filesToCommitgit commit -m "Commit comentary"
We push our commit to our branch.
git push origin newBranch
Alterlatively, we can use this instead:
git push -u origin newBranch
If we use the -u option, from now on we will be able to switch to the branch and just do:
git push
When we end our changes and we want to merge our branch to master we need to:
Switch to master, or to any branch we want to merge our changes to:
git checkout master
Merge our changes to our local copy of the destiny branch:
git merge newBranch
Now we push our changes to origin/master with:
git push origin master
If we dont need our branch anymore and there are not unmerged changes, we delete the branch with:
git branch -d newBranch