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

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

How can I change the path of a project in SourceTree?

I want to change the path of a project in SourceTree. All files in my user directory are accidentally in this project, and I just want to focus on a few files. How can I do that? I don't want to toss it in the trash, because then I will be tossing all my folders there! Thanks!

5 answers

I still only halfway understand what might have happened, I think you did a git init on your user folder.

Assuming this, you should see a hidden folder called ".git" under your user folder and this is what you have to do:

  1. create a new folder where you actually want your repo to be.
  2. move the .git folder into this new folder.
  3. if there are any files in your user folder which actually should be part of your new repo, copy or move them into the new folder, next to (not into) the .git folder
  4. Go back to SourceTree, create a new bookmark to point to the new folder and open it. (If you have a bookmark pointing to the old place, delete that.)

this helped me, thanks

I created a project, and now I have a ton of files that are untracked in it. I only wanted a couple of files in there, but because I created the wrong path, I ended up with all these files. I haven't done anything in the project. I just want to get rid of this path and just add the couple of files I want. However, since there are so many untracked files in there, it's difficult to do anything because now SourceTree is very slow. Hope this explanation helps clarify the issue. Thanks!

Are we talking about Git or Mercurial? What do you mean by "project"? Is it a repository?

It's Git, and yes, it's a repository. I accidentally made the path my user path (which means everything under the sun is in that repository. I just want to be able to connect it to a folder in a local development install like I had for my others. I'm still fairly new to SourceTree, so I accidentally created the new repository in bookmarks without dragging the folder in question into the bookmarks area. That resulted in the creation of a repository with a path to my user directory. I want to undo that and connect to the right area. Does that make sense? Thanks, by the way, for reaching out!

Mac or PC?

Suggest an answer

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

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

4,420 views 4 8
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