How do you clone a Git repository into a specific folder?
Executing the command git clone git@github.com:whatever
creates a directory in my current folder named whatever, and drops the contents of the Git repository into that folder:
/httpdocs/whatever/public
My problem is that I need the contents of the Git repository cloned into my current directory so that they appear in the proper location for the web server:
/httpdocs/public
I know how to move the files after I've cloned the repository, but this seems to break Git, and I'd like to be able to update just by calling git pull
. How can I do this?
Option A:
git clone git@github.com:whatever folder-name
Option B:
move the .git folder, too.
Better yet:
Keep your working copy somewhere else, and create a symbolic link.
The example I think a lot of people asking this question are after is this. If you are in the directory you want the contents of the git repository dumped to, run:
git clone git@github.com:whatever .
The "." at the end specifies the current folder as the checkout folder.
Go into the folder.. If the folder is empty, then:
git clone git@github.com:whatever .
else
git init
git remote add origin PATH/TO/REPO
git fetch
git checkout -t origin/master
链接地址: http://www.djcxy.com/p/2630.html
上一篇: 你如何加速Eclipse?