Changing the structure of Github folders

I am using Github for a website project. I have been checking the changes for a while, but now I want to change the folder structure, basically streamline the files better. Will it ruin my Github repository? If so, what is the best way for me to keep my versions unchanged, and my new folder structure synchronized with Git?

+6
source share
1 answer

In terms of Git, these will be simple file renames. To keep things simple, restructure with git commands:

git mv foo.c bar.c git mv old_dirname new_dirname git commit 

As you can see, you can also rename individual files or entire directories.

Git is able to keep track of individual file histories when renaming:

 git log --follow bar.c 

To make life easier for Git, if you rename or move the file, do not modify its contents in the same commit.

+4
source

Source: https://habr.com/ru/post/984589/


All Articles