[go: up one dir, main page]

Skip to content

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
Screenshot_2019-10-23_at_23.55.57 Screenshot_2019-10-23_at_23.56.22

However, a file within that folder preserves all history commits after the move:

Before After
Screenshot_2019-10-24_at_00.10.14 Screenshot_2019-10-24_at_00.09.28

Intended users

Edited by Denys Mishunov