* moving a repository question @ 2022-07-14 22:06 Paul Kinzelman 2022-07-14 22:59 ` Junio C Hamano 0 siblings, 1 reply; 4+ messages in thread From: Paul Kinzelman @ 2022-07-14 22:06 UTC (permalink / raw) To: git 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? In understanding the big picture... Is there any reason I can't just move or copy the entire .git tree someplace else if I wanted to move or make a copy? I realize about the clone command, but wouldn't just a straight copy be easier (in the vanilla case where no branches or anything complicate things)? TIA! -Paul Kinzelman ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: moving a repository question 2022-07-14 22:06 moving a repository question Paul Kinzelman @ 2022-07-14 22:59 ` Junio C Hamano 2022-07-15 16:59 ` Paul Kinzelman 2022-07-15 18:27 ` RDP over VPN can't see a .git directory to be able to pull Paul Kinzelman 0 siblings, 2 replies; 4+ messages in thread From: Junio C Hamano @ 2022-07-14 22:59 UTC (permalink / raw) To: Paul Kinzelman; +Cc: git Paul Kinzelman <paul@kinzelman.com> 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. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: moving a repository question 2022-07-14 22:59 ` Junio C Hamano @ 2022-07-15 16:59 ` Paul Kinzelman 2022-07-15 18:27 ` RDP over VPN can't see a .git directory to be able to pull Paul Kinzelman 1 sibling, 0 replies; 4+ messages in thread From: Paul Kinzelman @ 2022-07-15 16:59 UTC (permalink / raw) To: Junio C Hamano; +Cc: git Part of my question is just understanding git, it's different from another source control tool I've used. The other part is if I'm having trouble networking computers together, I'm wondering if I could copy everything under .git to a flash drive, then write the tree to another PC, and expect everything to work? And when they are able to network with each other, they should be in sync (assuming vanilla, no changes, no uncommitted files, etc.), and I could modify a file on one machine and expect that the other copied tree would be able to fetch it? Note, I'm talking a very vanilla case here, no complexity like you were mentioning, no branches, no uncommitted files, no multiple worktrees, no changes in files, no nothing. Just a straight simple single project. On 7/14/2022 4:59 PM, Junio C Hamano wrote: > Paul Kinzelman <paul@kinzelman.com> 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. ^ permalink raw reply [flat|nested] 4+ messages in thread
* RDP over VPN can't see a .git directory to be able to pull 2022-07-14 22:59 ` Junio C Hamano 2022-07-15 16:59 ` Paul Kinzelman @ 2022-07-15 18:27 ` Paul Kinzelman 1 sibling, 0 replies; 4+ messages in thread From: Paul Kinzelman @ 2022-07-15 18:27 UTC (permalink / raw) To: git I'm trying to 'git pull' between two W10 systems over a VPN with RDP. I map my local C:\ drive to drive s:\ on the remote system so on the remote system, I can see my local C:\ drive that has the repository On the remote system, I do git pull s:\gitrepository but it says ...does not appear to be a git repository, could not read from remote repository In a command line window on the remote system, I do dir s:\gitrepository and the .git directory is not shown in the listing. All the other files are including the .gitignore file (has a dot at the start). But I can do dir s:\gitrepository\.git and all the files and subfolders under .git are there. I've set the "Show hidden files, folders, and drives" radio button in the Folder Options | View window if that matters. Any idea why the .git directory is being blocked from being seen unless specifically specified, but I can see the .gitignore file just fine? ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-07-15 18:27 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-07-14 22:06 moving a repository question Paul Kinzelman 2022-07-14 22:59 ` Junio C Hamano 2022-07-15 16:59 ` Paul Kinzelman 2022-07-15 18:27 ` RDP over VPN can't see a .git directory to be able to pull Paul Kinzelman
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).