Import an existing GIT repository

Is there a specific procedure within SourceTree for importing an existing GIT repo? I've done this with SVN before in the past, but we're trying to essentially add an existing repo to a new remote to sync history to the new remote server.

Totally feel like I'm having a dumn moment right now. Thanks for your replies.

2 answers

1 vote
Colin Goudie Community Champion May 14, 2012

If the remote server is empty you just need to do a git command like

git remote add origin gitrepourl

Then

git push origin master

In SourceTree's Repository menu there is an 'Add Remote' option which I imagine is similar to the commands above

Click the 'Settings' button on the far right of the repository window toolbar, then in the Remotes section click 'Add' and provide the details (either manually, or use the 'Globe' button to pull a URL from your hosted repositories on Bitbucket etc if you've set those accounts up). You can then select this remote to push to.

Once you've synchronised, if you want to make this the default in future, you can remove the other remote and change the name of the new one to 'origin'.

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 Tuesday in Uncategorized

Friday fun: how many celebrates Midsummer holiday or is this a Swedish tradition only?

Any other country that celebrates Midsummer holiday (this friday 22 June)?  

40 views 3 1
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