I feel I'm missing something obious here, but I can't seem to find what I'm looking for.
I've created a local repo and would like to push it to BitBucket. I see I can remotes to a project, but I've not created a repo at BitBucket. I was wondering if SourceTree was able to do this? Or - what is the procedure for this?
Also, is there a way for SourceTree to link up with BitBucket and list all my BitBucket repos automatically?
Right now SourceTree for Windows doesn't have the ability to call the Bitbucket API to list your repositories and create new repositories, and grab the remote URLs for you. The Mac version does have this, and it will be coming to the Windows version soon.
For now, just create a new repository on Bitbucket via the web interface, then click 'I have code I want to import', then just copy the URL (looks like email@example.com/yourusername/yournewrepo.git). Then click 'Settings' on the toolbar on your repo tab, click Add to create a new remote, click the 'default remote' checkbox and then paste the URL into the URL / Path box. You can then push to Bitbucket.
Sorry, I'm new to version control, and programming in general.
I got this far, but I don't think it's what I'm after, it seems like the direction is local when I want the direction to be out i.e. push to the web. On the Mac you just go "Publish to remote" and your project (that you created locally can be pushed). How would I do that in the Windows version? Can you even do that in-app yet?
This question is about creating a BitBucket remote repository from inside the Source Tree application. (Note, it requires you to add your Bitbucket account in the application preferences).
Cam Newton, what you appear to be asking is, "How to push to a remote repository?"
In the case of a local git repo that has a corresponding remote repo, which you should have if you followed the image from above. Then you can simple commit your changes with the "Commit" button and then upload your commit to the remote - known as "Pushing" - with the "Push" button.
Hi Zak MO,
Thanks for the quick reply. I apologise if my question is unrelated to the thread topic. I'd just like to make sure by stating my situation. Maybe you can make sense of what I'm trying to ask, as I'm obviously very vague about how the whole thing works!
What I expected to happen was that I (am able to) hit Push and it detects there isn't a linked remote repo. It would then prompt me to point it to one, or create a new one as part of the one action. Is there something similar where I can do this seamlessly within Sourcetree?
Again, my apologies if my query is off-topic, I'm happy to discuss this in another thread if that's more appropriate!
If you've created a local repo and want to set the remote, I personally do it on the command line:
git remote add origin https://<USERNAME>@bitbucket.org/<USERNAME>/<REPONAME>.git
There is probably an option to 'set remote' you can find in the menus of source tree.
Also if your doing a unity project, please put this file in the top directory of your repository:
https://github.com/github/gitignore/blob/master/Unity.gitignore and call it ".gitignore"
In Unity you also need to Enable Visible Meta files via Edit->Project Settings->Editor.
For git to work with your unity project.
Sadly I'm not a command line kind of guy (i'm likely to do more damage than I am good), so I was hoping for a GUI option. I guess I'll just use the workaround and make a repo first in the web browser.
Thanks for the tips on setting Unity up with gitignore too, I'd already struggled past that hurdle! haha
This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.Read more
Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...
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!
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