Re: moving a repository question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Paul Kinzelman <paul@xxxxxxxxxxxxx> writes:

> I barely qualify as a novice on git, so my apologies in advance if this is a
> stupid question.
>
> Is everything that git needs stored in the .git tree?

Depends on what you want to do with "Git".

If you only copy .git/ and no file from the working tree, your "git
status" in the new location will report "you removed all the files
and you have nothing", for example.  If you are willing to do "git
reset --hard" after making such a copy of ".git/", it may be OK.  If
you had local changes in the working tree before taking a copy of
.git/, doing "git reset --hard" in the new location may not recover
the local changes in the original, so it may not be good and you may
have to copy the working tree files as well.

If you are using multiple worktrees linked to the repository,
copying .git/ is an absolute no-no.  Locations of secondary
worktrees are recorded in .git/ somewhere and copying them literally
would mean the new copy would mistakenly think that these secondary
worktrees linked to the original repository are linked to the new
copy instead.  There may be other things that will cause confusions
when copied.

"git clone" will of course sidestep all of these problems.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux