Message: previous - next
Month: February 2012

Howto move local git repository from ~/dirA -> ~/dirB

From: "David C. Rankin" <drankinatty@...>
Date: Sat, 18 Feb 2012 09:36:53 -0600

  With svn if I needed to more the location of my local repository, I could
simply move it. Like mv ~/test/tde ~/trinity. Can I do the same thing with a git
repository and not screw up the metadata in the tree?

  I note the .git directories in the tree contain worktree information:

09:34 nirvana:~/tdegit/tde> grep -r tdegit .git *
.git/modules/main/tdenetwork/config:    worktree =
.git/modules/main/tde-i18n/config:      worktree =
.git/modules/main/tdebase/config:       worktree =

  Can I move the tree and then just sed the worktree info, or will one of the
'git' commands do this for me?

David C. Rankin, J.D.,P.E.