I've recently started using git, Bitbucket, SourceTree and Xcode after years of being away. For the repo in question, I have two branches, master and develop. I use git commands from both the terminal (macOS) and Xcode. I work in the develop branch and occasionally merge develop to master.
Recently, I committed some changes in Xcode on the develop branch. Then I went to the terminal pushed with either 'git push' or 'git push origin develop.' Next, I realized that 'git branch' showed that my current branch was master. To fix this, I changed the branch to develop and merged from master to develop:
git checkout develop
git merge master
git push origin develop
I thought I fixed the problem and made several commit/pushes on develop. Now when I look at my develop commits in Bitbucket, I see a develop branch icon to the right of the message like this.
Here's what the History looks like in SourceTree.
Can anyone help me understand what's going on and how to fix it? I think that I need a refresher course in git so, if you have references for that, that would be great as well. Thank you.
Hello @Chuck ,
and welcome to the Community!
The reason why those commits are showing the "develop" branch tag is that those commits are not currently present in the main branch of the repository.
For every commit that is in a branch that was not yet merged to the main branch of a repository, you'll see that tag with the branch name.
The merge from master to develop you executed was successful, as illustrated in the graph by the yellow line meeting the blue line. After that, you pushed additional commits to the develop branch (Updated ..., Fixed..., Updated README file), and those were not yet merged back to the main branch.
This is why they are displayed with the "development" branch tag in the UI. As soon as you merge the develop branch with the main branch again, that tag should disappear.
As for refreshing the skills on git, Atlassian has a complete series of git tutorials that might be helpful:
I hope this helps! Let us know in case you have any questions.
Thank you, @Chuck !
Patrik S
Thank you Patrik! That helps immensely. I was convinced that I had done something wrong.
Now, I need to figure out how to stop needing to enter my passphrase in the macOS terminal for many git commands. I think that the solution is here: Set up Repository Access keys on macOS.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.