Moved folders should preserve commits history
Problem to solve
Whenever one moves folders within a repository, for example with git mv
, those folders seem to be loosing commits history. This seems to be relevant only for folders but might need deeper investigation. Due to git's nature, it tracks changes to content, hence once we move the folder to a new location, git sees it as a new content at that location, "hiding" original commits history.
Here is an example of how the commits history looks like before and after moving the same folder (gitlab-ui/components/base/button
) to a new location (gitlab-ui/src/components/base/button
) within the same repository.
Before | After |
---|---|
![]() |
![]() |
However, a file within that folder preserves all history commits after the move:
Before | After |
---|---|
![]() |
![]() |
Intended users
Edited by Denys Mishunov