SoruceTree renaming folders/directories

Mauricio Magni July 27, 2013

Hello

I cannot find how to rename a folder/directory using SourceTree. I only see files but no folders.

Could anybody point me in the right direction?

Kind regards,

Mauricio.

5 answers

1 accepted

0 votes
Answer accepted
KieranA
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.
July 29, 2013

Hi Mauricio,

We don't currently support renaming of folders, just files at the moment because of the way we treat the folder structure. I've filed a feature request for you on JAC, although you may want to indicate if this is for Windows or Mac. We'll likely do the same thing on both platforms. Here's the issue: https://jira.atlassian.com/browse/SRCTREE-1729

Hope that helps!

0 votes
cvramirez November 4, 2015

If having issues with this working via the SourceTree interface, this simple command works perfectly.

  1. click on Terminal button in tool bar
  2. terminal will automatically open to directory of proper repo
  3. type the following:  hg addremove --similarity 100
The 100 means files must be 100% the same, so if you just moved them, they will be... I you moved and renamed, you can also use a high number, say 93, and perhaps that will work for you. Either way, the command will list all of the files and their percent similarity.
I got the tip here:  http://hgtip.com/tips/advanced/2009-09-30-detecting-renames-automatically
Francis Vila January 18, 2018

I get

  • "hg: command not found" for hg addremove --similarity 100
  • "hg is not a git command" for git hg addremove --similarity 100

Also where in those commands do you specify the new name of the folder?

0 votes
Mauricio Magni July 30, 2013

Thank you Steve.

0 votes
Mauricio Magni July 29, 2013

Hello Johannes, Kieran

Thank you for your answers. I'm running SourceTree on Windows. I'll give a try to the solution proposed by Johannes.

Kind regards,

Mauricio.

stevestreeting
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.
July 30, 2013

Yes, just rename the folder in Explorer then use the Add/Remove button in SourceTree, and Git will pick up that the files have been moved automatically.

0 votes
Johannes Kilian
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.
July 28, 2013

I think it's not possible at the moment (I searched for it myself in vain ...)

As git is a content tracking system, you can simply move the file within your directory tree using standard explorer actions. Doing so the hash-value (sha1) of the file keeps the same - the only thing that changes is the object tree. Git will automatically recognize the change in the directory tree, which can be commited

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events