Forums

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

How do I merge a new branch into my main branch? I am running into issues

jim.hoitela
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!
September 29, 2022

I created a new branch called aws.

I am trying to merge it into master (which is my main branch)

I have tried to do git checkout master

git merge aws

It tells me it's "Already up to date"

I then tried git checkout master 

git reset --hard master

I keep reading suggestions and I am not making any progress.

1 answer

0 votes
Caroline R
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 4, 2022

Hi, @jim.hoitela, welcome to the community! 

"Already up to date" means there are no new commits on the new branch aws that are already within the master. 

Could you please diff the branches to confirm the output? You can run the following command to do that:

git diff master..aws

If there's no output, that means you simply need to check out aws again, commit the changes you made and confirm that running git diff master..aws actually yields a result. Then you can checkout master and merge.

In case it doesn’t work, could you please try to pull from the specific remote branch

git pull origin master

Then try to  push changes to that remote branch

git push origin master

Looking forward to hearing from you. 

Kind regards,
Caroline

jim.hoitela
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!
October 4, 2022

Caroline,

Thanks. And thanks so much for your response.

I did the 

git diff master..aws

 and it didn't return any result.  I update one file and then did it again and I then I get output.

I then tried to merge aws.  It seemed to work but when I looked into the actual repository online none of the updates done in the aws branch were merged.

I did try to do a pull from the remote branch - aws and then tried to push the changes into the main branch and it's not working.

Caroline R
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 5, 2022

Hi @jim.hoitela, thanks for getting back to us! 

You mentioned that:

"It seemed to work but when I looked into the actual repository online none of the updates done in the aws branch were merged"

So I would like to understand if you pushed your local changes to your remote repository after changing it locally. 

The reason I'm asking this is that in order for your remote branches to have the same content as your local branches, you need to push the local changes to your remote repository. Maybe this Git tutorial helps you in this case: 

Please let me know if it helps and feel free to share any additional questions regarding this case.

Kind regards,
Caroline

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events