Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to branch and merge properly with Git?
    text
    copied!<p>I have searched all other the web and read many instructions but it just doesn't work and/or behave how I expected.</p> <p>I was working in master and had just finished working on version 0.1 on my project and wanted to branch away from it in order to have an easily accessible snapshot of 0.1. I was currently working in master so I ran:</p> <pre><code>git branch 0.1 </code></pre> <p>This created a branch on my machine just fine but I couldn't figure out for the life of me how to push it. I ended up running:</p> <pre><code>git config push.default current </code></pre> <p>Now I could swap between projects using:</p> <pre><code>git checkout </code></pre> <p>And I was able to push them just fine and had both branches on github. I then added a log file to 0.1 which simply said "0.1 Snapshot test", commit and pushed it fine. Then I decided I wanted that log in the master branch so I ran:</p> <pre><code>git merge 0.1 </code></pre> <p>Then I pushed it. This has now kept 0.1 on my machine but has removed 0.1 from github. Edit: actually it appears it's still on github, just hidden when looking at the overall Master page.</p> <p>I guess I'm not really sure how I should be using git in order to keep track of previous but completed versions. Which order should I branch and merge in? Was this because I was working in Master that I got confused? I read through all of this but it just confused me more: <a href="http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging" rel="nofollow">http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload