It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Easy way to keep a copy of my repo on a USB?

Is there any easy way to keep a copy of my repo on a USB by using Sourcetree + Mercurial + Bitbucket?

I mean having a everything synchronized with my local working directory and my remote repository at Bitbucket or Github?

Here some people explains how to do it with git commands

https://stackoverflow.com/questions/38153478/copying-a-git-repository-to-usb-drive

But I'd like to get it from the Sourcetree GUI, and I'm using Mercurial at Bitbucket, though a Git solution would also be nice..

 

I'm using repository to keep a copy of a project I'm doing for my PhD. And I work both from the university and home.  But sometimes I don't have Internet at home and I need to rely on a USB.

4 answers

0 votes
Ana Retamal Atlassian Team Dec 06, 2018

 

Hi Juan, welcome to the Community!

First of all, let me say this is not a question about Bitbucket or Sourcetree, more about Mercurial, but let me try to help anyway.

If you're already using Bitbucket, Github, and Sourcetree and have copies of your repo in all the three of them, you'll be able to always have them in sync. Getting a copy of your repository in your USB drive is as simple as copy-pasting the whole directory into it.

The article you linked is doing something different because it's not just keeping a copy of the repo, is adding it as a remote, which I believe would work better in your case. If you'd like to do that, you'll need to use Mercurial commands (not Git) and I recommend you check their documentation at https://www.mercurial-scm.org/wiki/QuickStart. You won't be able to do that from Sourcetree, you'll need to use the terminal, though. Is there any reason why you'd want to use Sourcetree for that?

Is there a reason why you'd want to use Git too? Mercurial and Git are different systems, and you'd need to convert from one to the other, or you could use this plugin to collaborate to the same repo using both systems.

Hope that clarifies some things, Juan. Let us know if you have any questions!

Cheers,

Ana

I named Git just as an example and possible alternative but I'm really interested on a Mercurial solution.

The truth is that I know very little about all these tools. I've decided to use Mercurial through SourceTree because it's more comfortable than the command line.

And yes, manually copying the folder every day is what I was trying to avoid. I'd like to keep everything synched on Bitbucket and my USB by just pressing the "Pull" option on SourceTree.

 

Muchas gracias Ana.

Maybe I can do it by cloning the repository to my USB.

https://confluence.atlassian.com/bitbucket/clone-a-repository-223217891.html

But I can't find the "Clone" option on Sourcetree.

Where is it?

Hola Juan! 

If you have your repo locally in your machine, you don't need to clone it (a clone would be a copy from the remote repository if it was hosted in Bitbucket for example), you can import it into Sourcetree using the menu on top: File > New > Add existing local repository and navigate to the directory where your repo is. 

Could you do it?

Saludos,

Ana

Then I will end up having two repos, one on my pendrive and another one on my hard disk and every day I will need to push the content of any of them to bitbucket and later pull it back to the other repo (for example disk -> bitbucket -> usb), isn't it?

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Sourcetree

Sourcetree for Windows - CVE-2019-11582 - Remote Code Execution vulnerability

A vulnerability has been published today in regards to Sourcetree for Windows.  The goal of this article is to give you a summary of information we have gathered from Atlassian Community as a st...

4,902 views 0 12
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you