{"thread":{"id":"58162","subject":"moving a repository question","startedAt":"2022-07-14T22:06:41Z","lastAt":"2022-07-15T18:27:26Z","messageCount":4,"participants":["Paul Kinzelman","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"459098","messageId":"2e592944-edb8-2d49-981a-8ad220f97e82@kinzelman.com","threadId":"58162","inReplyTo":null,"subject":"moving a repository question","fromName":"Paul Kinzelman","fromEmail":"paul@kinzelman.com","sentAt":"2022-07-14T22:06:34Z","receivedAt":"2022-07-14T22:06:41Z","isPatch":false,"sender":{"key":"paul@kinzelman.com","avatar":null},"body":"I barely qualify as a novice on git, so my apologies in advance if this is a\nstupid question.\n\nIs everything that git needs stored in the .git tree?\n\nIn understanding the big picture...\nIs there any reason I can't just move or copy the entire .git tree\nsomeplace else if I wanted to move or make a copy?\n\nI realize about the clone command, but wouldn't just a straight\ncopy be easier (in the vanilla case where no branches or anything\ncomplicate things)?\nTIA!\n-Paul Kinzelman\n\n"},{"id":"459101","messageId":"xmqqilnz2tck.fsf@gitster.g","threadId":"58162","inReplyTo":"2e592944-edb8-2d49-981a-8ad220f97e82@kinzelman.com","subject":"Re: moving a repository question","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-07-14T22:59:55Z","receivedAt":"2022-07-14T23:00:02Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Paul Kinzelman <paul@kinzelman.com> writes:\n\n> I barely qualify as a novice on git, so my apologies in advance if this is a\n> stupid question.\n>\n> Is everything that git needs stored in the .git tree?\n\nDepends on what you want to do with \"Git\".\n\nIf you only copy .git/ and no file from the working tree, your \"git\nstatus\" in the new location will report \"you removed all the files\nand you have nothing\", for example.  If you are willing to do \"git\nreset --hard\" after making such a copy of \".git/\", it may be OK.  If\nyou had local changes in the working tree before taking a copy of\n.git/, doing \"git reset --hard\" in the new location may not recover\nthe local changes in the original, so it may not be good and you may\nhave to copy the working tree files as well.\n\nIf you are using multiple worktrees linked to the repository,\ncopying .git/ is an absolute no-no.  Locations of secondary\nworktrees are recorded in .git/ somewhere and copying them literally\nwould mean the new copy would mistakenly think that these secondary\nworktrees linked to the original repository are linked to the new\ncopy instead.  There may be other things that will cause confusions\nwhen copied.\n\n\"git clone\" will of course sidestep all of these problems.\n"},{"id":"459159","messageId":"337199fe-4e5a-3f07-7ae6-2867e5cc3410@kinzelman.com","threadId":"58162","inReplyTo":"xmqqilnz2tck.fsf@gitster.g","subject":"Re: moving a repository question","fromName":"Paul Kinzelman","fromEmail":"paul@kinzelman.com","sentAt":"2022-07-15T16:59:06Z","receivedAt":"2022-07-15T16:59:17Z","isPatch":false,"sender":{"key":"paul@kinzelman.com","avatar":null},"body":"Part of my question is just understanding git, it's different from another\nsource control tool I've used.\n\nThe other part is if I'm having trouble networking computers together,\nI'm wondering if I could copy everything under .git to a flash drive,\nthen write the tree to another PC, and expect everything to work? And when\nthey are able to network with each other, they should be in sync\n(assuming vanilla, no changes, no uncommitted files, etc.), and\nI could modify a file on one machine and expect that the other\ncopied tree would be able to fetch it?\n\nNote, I'm talking a very vanilla case here, no complexity like you were\nmentioning, no branches, no uncommitted files, no multiple worktrees,\nno changes in files, no nothing. Just a straight simple single project.\n\nOn 7/14/2022 4:59 PM, Junio C Hamano wrote:\n> Paul Kinzelman <paul@kinzelman.com> writes:\n>\n>> I barely qualify as a novice on git, so my apologies in advance if this is a\n>> stupid question.\n>>\n>> Is everything that git needs stored in the .git tree?\n> Depends on what you want to do with \"Git\".\n>\n> If you only copy .git/ and no file from the working tree, your \"git\n> status\" in the new location will report \"you removed all the files\n> and you have nothing\", for example.  If you are willing to do \"git\n> reset --hard\" after making such a copy of \".git/\", it may be OK.  If\n> you had local changes in the working tree before taking a copy of\n> .git/, doing \"git reset --hard\" in the new location may not recover\n> the local changes in the original, so it may not be good and you may\n> have to copy the working tree files as well.\n>\n> If you are using multiple worktrees linked to the repository,\n> copying .git/ is an absolute no-no.  Locations of secondary\n> worktrees are recorded in .git/ somewhere and copying them literally\n> would mean the new copy would mistakenly think that these secondary\n> worktrees linked to the original repository are linked to the new\n> copy instead.  There may be other things that will cause confusions\n> when copied.\n>\n> \"git clone\" will of course sidestep all of these problems.\n\n"},{"id":"459164","messageId":"9ccd1e5b-f8f7-f6c9-9e1b-0058ec71cda5@kinzelman.com","threadId":"58162","inReplyTo":"xmqqilnz2tck.fsf@gitster.g","subject":"RDP over VPN can't see a .git directory to be able to pull","fromName":"Paul Kinzelman","fromEmail":"paul@kinzelman.com","sentAt":"2022-07-15T18:27:05Z","receivedAt":"2022-07-15T18:27:26Z","isPatch":false,"sender":{"key":"paul@kinzelman.com","avatar":null},"body":"I'm trying to 'git pull' between two W10 systems over a VPN with RDP.\n\nI map my local C:\\ drive to drive s:\\ on the remote system so on the remote\nsystem, I can see my local C:\\ drive that has the repository\nOn the remote system, I do\n     git pull s:\\gitrepository\nbut it says\n     ...does not appear to be a git repository, could not read from \nremote repository\n\nIn a command line window on the remote system, I do\n     dir s:\\gitrepository\nand the .git directory is not shown in the listing. All the other files are\nincluding the .gitignore file (has a dot at the start).\n\nBut I can do\n     dir s:\\gitrepository\\.git\nand all the files and subfolders under .git are there.\n\nI've set the \"Show hidden files, folders, and drives\" radio button in \nthe Folder\nOptions | View window if that matters.\n\nAny idea why the .git directory is being blocked from being seen unless\nspecifically specified, but I can see the .gitignore file just fine?\n"}]}