Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you are using this form of the <code>branch</code> command (with start point), it does not matter where your <code>HEAD</code> is.</p> <p>What you are doing:</p> <pre><code>git checkout dev git branch test 07aeec983bfc17c25f0b0a7c1d47da8e35df7af8 </code></pre> <ul> <li><p>First, you set your <code>HEAD</code> to the branch <code>dev</code>,</p></li> <li><p>Second, you start a new branch on commit <code>07aeec98</code>. There is no bb.txt at this commit (according to your github repo).</p></li> </ul> <p>If you want to start a new branch <em>at the location you have just checked out,</em> you can either run branch with no start point:</p> <pre><code>git branch test </code></pre> <p>or as other have answered, branch and checkout there in one operation:</p> <pre><code>git checkout -b test </code></pre> <hr> <p>I think that you might be confused by that fact that <code>07aeec98</code> is part of the branch <code>dev</code>. It is true that this commit is an ancestor of <code>dev</code>, its changes are needed to reach the latest commit in <code>dev</code>. However, they are other commits that are needed to reach the latest <code>dev</code>, and these are not necessarily in the history of <code>07aeec98</code>.</p> <p><code>8480e8ae</code> (where you added bb.txt) is for example not in the history of <code>07aeec98</code>. If you branch from <code>07aeec98</code>, you won't get the changes introduced by <code>8480e8ae</code>.</p> <p>In other words: if you merge branch A and branch B into branch C, then create a new branch on a commit of A, you won't get the changes introduced in B.</p> <p>Same here, you had two parallel branches master and dev, which you merged in dev. Branching out from a commit of master (older than the merge) won't provide you with the changes of dev.</p> <hr> <p>If you want to <em>permanently</em> integrate new changes from master into your feature branches, you should merge <code>master</code> into them and go on. This will create merge commits in your feature branches, though.</p> <p>If you have not published your feature branches, you can also rebase them on the updated master: <code>git rebase master featureA</code>. Be prepared to solve possible conflicts.</p> <p>If you want a workflow where you can work on feature branches free of merge commits and still integrate with newer changes in master, I recommend the following:</p> <ul> <li>base every new feature branch on a commit of master</li> <li>create a <code>dev</code> branch on a commit of master</li> <li>when you need to see how your feature branch integrates with new changes in master, merge both master and the feature branch into <code>dev</code>.</li> </ul> <p>Do not commit into <code>dev</code> directly, use it only for merging other branches.</p> <p>For example, if you are working on feature A and B:</p> <pre><code>a---b---c---d---e---f---g -master \ \ \ \-x -featureB \ \-j---k -featureA </code></pre> <p>Merge branches into a <code>dev</code> branch to check if they work well with the new master:</p> <pre><code>a---b---c---d---e---f---g -master \ \ \ \ \ \--x'---k' -dev \ \ / / \ \-x---------- / -featureB \ / \-j---k--------------- -featureA </code></pre> <p>You can continue working on your feature branches, and keep merging in new changes from both master and feature branches into <code>dev</code> regularly.</p> <pre><code>a---b---c---d---e---f---g---h---i----- -master \ \ \ \ \ \ \--x'---k'---i'---l' -dev \ \ / / / \ \-x---------- / / -featureB \ / / \-j---k-----------------l------ -featureA </code></pre> <p>When it is time to integrate the new features, merge the feature branches (not <code>dev</code>!) into master.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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