Can't check in files in SourceTree

I'm a first time user of SourceTree and am trying to check in an existing project into BitBucket. Sorry, this is probably simple but I can't figure it out. I am working from a Windows computer and have a set of source code in a directory on the computer. How do I check it in? I tried drag and drop into the bookmarks section in the left pane of the SourceTree client, but no-go.

Or if there is any documenation anywhere, can you point me to it?

1 answer

If your existing code is already a Git or Mercurial repo, you can add it to SourceTree using the "Add Working Copy" tab in the Clone/New dialog. Otherwise, add it to SourceTree in the "Create New Repository tab. You may have to commit the code to the new repo.

In Bitbucket, create a new repository. Add this new repo to your SourceTree repository as a remote. Push your branch to the Bitbucket remote.

Thanks, but can you give me more detailed instructions (or point me to some documentation -is there any)? I created the repository, and it seemed to let me add my code, but when I go to view the tree in bitbucket, there is nothing there.

Have you used Git before? Your confusion sounds like it stems from a misunderstanding of the differences between Git/Hg versus CVS/SVN.

You're right - I've used GIT but am rusty. I am more experienced with CVS and SourceSafe. That's why I could use some doc. What I want to do must be pretty straightforward - just initialize a new repository with an existing project, but I can't get it to work!

Sooo... a little help please?

Yeah, I thought I responded, but it disappeared.

SourceTree is not just a desktop interface for Bitbucket. According to the design of Git (and Mercurial), you are actually working with two distinct repositories. One of those repositories resides on your local machine, optionally managed by SourceTree. The other resides on Atlassian servers, managed by Bitbucket.

You can (and should) link these repositories to each other by configuring your local repository to view the Bitbucket one as a "remote".

Once Bitbucket is a remote, it is important to know the differences between your operations. Some, like "Commit" and "Checkout", usually operate only on your local repository. Others, like "Push" and "Pull", are used to syncronize the local and remote repos.

To add a remote, go to the Repository menu and choose "Repository Settings..."

Aha! I am away from the computer so can't test this now, but I'm sure that's it. Thanks! But my other question is - is there any documentation for SourceTree?

The only official documentation I've heard of is in the Help menu on the Mac version. It will be added to Windows "soon" (according to Atlassian staff months ago).

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
Published May 30, 2018 in Sourcetree

Tip from the team: configuring Git or Mercurial in Sourcetree

Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...

567 views 1 2
Read article

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