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

Keep history when moving/renaming files Edited

 

Hi, I've been reading several questions but I can't get things clear. Let's say I have the following file structure:

myapplication/test/file1.kt

and then I rename 'test' folder to 'test1', then  the current state is:

myapplication/test1/file1.kt

 What I found in source tree is that two sections appear: one with staged files, where the change has been detected as a rename and the other one with unstaged files.

After doing some tests, I've reached the conclusion that the only way to keep the history of the 'file1.kt' is to commit first the unstaged files, where the rename is detected and then commit the rest. Otherwise if I do it in just one commit, the change is detected as a delete and an addition, losing the history as a consequence. Can someone explain to me why it works like this and how should be done properly? In this thread they comment that renaming and editing shouldn't be done in the same commit, I don't know if it has some relation.

 

Thanks in advance.

sourcetree.png

0 answers

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

2,748 views 0 10
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