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

How to clone and push a Git repo upstream using SourceTree?

Mike Wirth February 25, 2014

Hi, folks,

Git, Atlassian, etc., newbie here. Have a "working" Git repo on my Win7 PC (actually a Parallels VM running on my Macbook Pro :-) which I created and to which I have been adding commits using the SourceTree app. So far, so good. But how do I:

  1. Clone it to the "cloud", i.e., copy to Bitbucket?
  2. Make the appropriate settings and linkages so that the Bitbucket clone is the "Master" and, when I commit further changes locally on my PC, I can "push" them manually or automatically to the Master?
  3. How do I share access to the Master, so that I can allow another Atlassian account holder to create a clone on their local machine, and push/pull changes? (I imagine that this item is "standard" enough that you can just point me at a section of the docs or tutorials for how to accomplish it.)

Asking for help here because I found the following items confusing (and you can take their clarification as desired enhancements to the product.)

  1. The online tutorials for command line Git operations and usage scenarios were useful, but didn't find any written in terms of SourceTree and it wasn't obvious in some cases how to directly connect one with the other.
  2. I'm not very clear on how Atlassian accounts and your various products relate to one another, and how they interoperate. Is there an overview document that describes this?
  3. Have some questions on holding multiple accounts. I'm sending this question while logged into my "personal" account (i.e., with my personal email address in my profile). I also should have a commercial account (i.e., with another email address and domain name, part of the Atlassian account for that domain holder). But my second (commercial) email address isn't recognized by Atlassian, even in the "Forgot my password" procedure. Maybe I'm confusing the two. (Will try to sort this out with the commercial account holder.)

Thanks for any enlightenment :-)

Mike

2 answers

0 votes
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 25, 2014

Once you have a bitbucket repository, there is a prominent option on the repo dashboard to invite other users.

0 votes
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 25, 2014

That is a lot of questions seeking a lot of different answers. I am addressing the first 2 in your first set of 3, which boils down to: "How do I get my existing repository into the cloud and linked with SourceTree?"

1. Create a new repository in BitBucket.

2. Click the link to "I have an existing project to push up". That link will give you these commands to run locally (will include your specific remote url):

cd /path/to/my/repo
git remote add origin https://user@bitbucket.org/owner/repo.git
git push -u origin --all # pushes up the repo and its refs for the first time
git push -u origin --tags # pushes up any tags

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events