Jump to content

Git: Difference between revisions

74 bytes added ,  19 December 2022
Line 44: Line 44:


==Branches==
==Branches==
You should make branches per-feature. 
Branches allow you to work on the repository without creating new forks and using more disk space.
This allows you to work on your feature from a static copy of the code repo.   
You can use them to create and test changes from a static copy of the code repo.   
You can also discard this branch if you decide the feature is no longer needed.   
You can also discard a branch if you decide the feature is no longer needed.   
Once the feature has been fully developed, you should rebase the branch onto the head of master.   
Once the feature has been fully developed, you should rebase the branch onto the head of the main branch.   
Then you can merge the branch to add the feature to master.
Then you can merge the branch to add the feature to main/master.


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">