How to reset the head to enable merge

Hi,

I am new to working with git and SourceTree, so I need some help. A few information up front: I work together with another collegue on a shared git repository. I made some changes to some files and then commited my changes. When I wanted to push my commits, my colleague had already pushed some other changes, but I didn't pull them before I tried to push myself. So Sourcetree opened up another branch. I wasn't sure how to merge the new branch with my local head without losing my own changes, so I tried out a lot of things including stashing and resetting commits. Now I am pretty much clueless what to do to get everything back to normal without losing my changes. Here is a photo of the current status: 

Bildschirmfoto 2017-06-22 um 14.03.32.png

 

Thanks for your help.

1 answer

0 vote

You could try interactive rebasing or squashing.

Alternatively you could delete that 'extra' branch after selecting them and using the "Create Patch…" (From Commits). Then you can just re-apply them on a version clone without any worries beyond the change in metadata.

To reset a merge in progress use the "Reset…" (or "Revert…" for Mercurial) and choose the Reset All tab.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Brian Ganninger
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...

647 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you