Bitbucket: How to download the latest branch onto my local machine?

I'm in deep trouble... I have the latest and greatest branch in my remote Bitbucket repo. How do I get that branch loaded onto my local machine, without the conflict marks?

<<<<<<< HEAD
>>>>>>> 1.9.31

I've also accidently deleted the local repo! How do I get everything back the way it was this morning?

3 answers

1 accepted

0 votes
Accepted answer

You probably want "git reset --hard". This will clear all working directory changes.

Thanks for your input.. I wound up getting the latest correct version from TIme Machine... I'm good to go now, but not so sure I'm gonna continue using Git...

From Time Machine? So either you didn't actually want exactly what was in the remote repository, or you had it at some point and then modified your files. The diff in the original post looks like a line break is added/removed. Any versioning system worth its salt is going to treat whitespace changes as changes.

What is the name of the "latest and greatest" branch? Which command are you running that results in the conflict?

In terms of repo deletion, did you have any local commits or changes that were not pushed to any remotes? If so, you'll want to pursue file recovery tools. If everything was pushed, you should be able to restore by cloning and checking out the appropriate branches.

Latest and greatest: 1.9.3 (1.9.31 was the exact duplicate of 1.9.3, so I deleted it) :-{

Apparently a merge didn't finish, so I have all of these conflict markers...

From what I can tell, all of my changes were committed and pushed to the remote (Bitbucket), because I can see them when I look at the remote branch source.

The question is: how do I get a copy of EXACTLY what's in the remove branch 1.9.3 WITHOUT all of the conflict markers (they don't appear in the source in Bitbucket, so who/what is putting them there? and how do I get a clean copy of the remote branch?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

1,955 views 7 10
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