What is proper method for renaming files or folder in Source Tree - Mercurial - Windows 7?

Currently I rename all files then in Source Tree, it shows all of the old named files as being removed and shows all the new named files. I know on my Apple computer there is a move option on my right click menu. What is the current best practice for renaming folders and files using Mercurial on Windows 7?

3 answers

1 accepted

If there are any changes internal to the files or folders, Source Tree will assume that you have deleted the previous files and are adding new files (that have a different name or different folder name). This causes these renamed files or the files under the renamed folder to lose the revision history linked to that file.

I discovered that as long as you do not have any content changes in the files or folder for a commit, you can rename them with Source Tree understanding that these are the same file by clicking on Add/Remove. It will then show these files as "moved" and retain the history of this file properly.

0 vote
Timothy Chin Community Champion Sep 22, 2013

Same. Just rename the file in the windows explorer. hg or Git will pick it up as a deleted and an add.

There is now a MOVE command that will solve this problem. You can right-click on the file, select Move..., and then choose a new name.

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...

562 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