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

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

Juan December 5, 2018

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
Juan December 7, 2018

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?

0 votes
Juan December 6, 2018

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?

Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 7, 2018

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

0 votes
Juan December 6, 2018

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.

0 votes
Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 6, 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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events