myusrn
myusrn

Reputation: 1110

Expanding local repo .git contents

If I copy <local repo path>\.git from wksA to wksB, as a shortcut for having to publish to a remote repo and clone from there, is there a git command for expanding the folder and file contents of that copied <local repo path>\.git on the target system?

Upvotes: 2

Views: 266

Answers (2)

kdopen
kdopen

Reputation: 8215

Rather than copying the .git directory (which might have hard-coded paths in it), you should just make a local clone from your original directory.

git clone /path/to/wksA wksB

This doesn't need you to go through a remote, creates a clean (properly set up) copy of the repository, and has the added advantage, BTW, that you can use wksA as a remote (think 'local backup')

Upvotes: 1

VonC
VonC

Reputation: 1326366

Simply pick a branch and checkout it:

git checkout master

You can specify the current folder as well:

git checkout master -- .

Upvotes: 2

Related Questions