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

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

22,448 views 26 12
Join discussion

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