DIY Git Repos
2013-05-27
I have several sites that I’ve been tracking with Git on my desktop and want to be able to work on my laptop and keep it all in sync. Here’s what I did:
- Created a repos directory in my home directory
- cd into it
- $ git clone –bare /var/www/html/[site-dir] for each site
- Go into the actual directory for each site and point the new bare repo as its master:
$ git remote add origin ~/repos/[site-name].git
$ git branch –set-upstream master origin/master - On the laptop, cd to /var/www/html and for each site:
$ git clone user@desktop:~/repos/[site-dir].git - Then use git pull and git push to keep the directories synced up
Written on May 27, 2013