Tim
Tim

Reputation: 99526

Is it okay to move the parent directory of a git repository?

Suppose in my local machine I have a git repository which is synced with a remote git repository in github.com.

The local git repository in my machine is /home/t/work/project1/.git.

Does it change any thing related to git, if I move /home/t/work/project1 to be under a directory which is not under /home/t/work/project1, for example, /home/t/work/projects?

Thanks.

Upvotes: 1

Views: 546

Answers (2)

Matias Elorriaga
Matias Elorriaga

Reputation: 9150

yes, there is no problem. git information is stored inside .git folder (hidden), so it's ok to move the complete folder.

Upvotes: 2

Pradeeban Kathiravelu
Pradeeban Kathiravelu

Reputation: 841

You are moving the entire source tree. Git metadata is in a folder typically a hidden folder named as .git in the root folder. Since you are moving everything, relatively nothing changes. So you will be fine moving the parent directory. Unlike moving the child directories, nothing changes by such a move.

Upvotes: 1

Related Questions