It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Checking in first time code Edited

New user with SourceTree.  I created a project on GitHub and I'm trying to check my local repo in for the first time into the "empty" project.  It seems to be a bit of a chicken and the egg situation with the software.

Scenario 1:  In SourceTree, click on Clone.  Attempt to clone the "empty" GitHub into the "real-code" local Repo gives error:  Cannot Clone into Non-Empty Folder.

I can clone the "empty" remote GitHub repository into an empty folder but that is not going to do me any code because my local repository in "MY EXISTING" folder is where the "FIRST" incarnation of the code IS.

Scenario 2:  Click Create in SourceTree, create a repository on GitHub from local Repo.  Same Error.

Does SourceTree have a get-init function to initialize the existing folder and source for SourceTree/Git?

There are only so many buttons in SourceTree and for the most part there are no more to click on that I can see.  Exactly HOW are you supposed to do this?  How do you get the first code checked-in?  It kinda gives you a bad taste to immediately get stuck with new software for a common first time use scenario. 


1 answer

1 accepted

0 votes
Answer accepted
Ana Retamal Atlassian Team Oct 30, 2017

If my understanding is correct, you're trying to "upload" your repo from your local machine to Github, is this correct?

In that case, I'd just follow the instructions provided by Github on how to do so, and once Github has my project I'd use Sourcetree to connect between Github and local.

You can find Github's instructions at Adding an existing project.

Let us know if you have any questions!



Ana:  It was a mess.  I figured it out without your instructions but did roughly the same thing.  

I got it to work by dropping to the command line and doing a git init for my local folder.  This created the local repo which sourcetree really has no way to do natively do --- and "it should"!

So via the command line I had to do this:

cd existing_folder
git init
git add .
git commit

Now, that still won't do anything because there is still no way to directly merge the local repo you just created with the github remote repo because you can't checkout and commit the remote repo since the local repo is basically on a branch outside of SCC.  I had to checkout the remote, pull it, then rebase my local repo to it, then commit the whole thing. 

Really all of this should be ONE Single command called "check code in for the first time" to a remote Repo.

It is working now, but this "chicken and the egg" problem gives any new user the feeling that SourceTree is not ready for prime time.  Giving someone instructions to go to the command line for a GUI tool makes no sense whatsoever. 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Sourcetree

Sourcetree for Windows - CVE-2019-11582 - Remote Code Execution vulnerability

A vulnerability has been published today in regards to Sourcetree for Windows.  The goal of this article is to give you a summary of information we have gathered from Atlassian Community as a st...

4,955 views 0 12
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you