Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to reset the head to enable merge

Stefan Kemler June 22, 2017

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 votes
bgannin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 26, 2017

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.

bgannin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 26, 2017

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
TAGS
AUG Leaders

Atlassian Community Events