Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 246
newbie Avatar asked Mar 31 '26 02:03

newbie


1 Answers

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
like image 180
VonC Avatar answered Apr 02 '26 21:04

VonC