开发者

git version control with local files

Ok I have a project in a folder called mywebsite which is located in my documents folder on my mac. How do I use git开发者_高级运维 to version control this folder??

Every time I try something I end up with a fatal error of some sort and it's really annoying me now, can you help?

I do git init, then mkdir and then I've tried adding and cloning the files to no avail.

git init 
git mkdir mywebsite 
cd mywebsite 
git clone file://localhost/Users/me/Documens/sites/mywebsite 
fatal '/Users/me/Documens/sites/mywebsite' does not appear to be a git repository 
fatal: The remote end hung up unexpectedly

Please help!


If you have already files in 'mywebsite':

cd /Users/me/Documens/sites/mywebsite
git init . # note the final '.'

then do a git status to see what needs to be added.

git add .
git status # check what has been added
git commit -m "first commit" 

If you haven't any file yet, you can:

cd /Users/me/Documens/sites/
git init mywebsite
cd mywebsite # you are now in an empty git repo
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜