Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

After creating a branch from master I have to sync with master to get its source. Why?

walkipedia
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 19, 2020

I'm finding that after creating a branch from master that the new branch doesn't have the same source code as master. Ultimately I have to sync the new branch with master after creating the branch to get it to see master's source. Why is that? The steps below show what I'm doing, or I made a movie of this: https://youtu.be/m0rhpG6Skac

1) In Bitbucket (on the website) I create a new branch (BranchB) from master.

2) I fetch and then checkout BranchB locally

3) I create a text file called BranchB.txt and save it.

4) I use git status to verify that git sees the untracked file

5) I add the file, make a commit, and then push the branch to remote

6) I verify in BitBucket that the branch was just updated and then merge with the master branch (presumably master has branchB.txt at this point)

7) I create a new branch from master called BranchC using Bitbucket website

8) I fetch and checkout BranchC locally verifying that I am on that new branch

9) I find that BranchB.txt is NOT THERE. Why is that???

10) On the BitBucket website, I find that BranchC is two commits behind master. Why??

11) I sync BranchC with master (a step I wouldn't have thought necessary)

12) I verify that BranchB.txt now exists in BranchC on remote

13) locally I do a git pull and verify that BranchB.txt exists.

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events