Local git repository using window 7 with XAMPP server
I am working on a project configured on Windows 7 machine. I am the only developer working on it, so I want to setup a private Git repository on the same machine and want to work by creating git branches. Can anyone let me know how can I create git repository with my current system.
2 Solutions collect form web for “Local git repository using window 7 with XAMPP server”
If you haven’t yet installed git on your Windows machine, get the latest version from here
You can create a git repository on local machine and clone it on the same machine.
But I would suggest you to host your code on server, so there are less chances of loosing your hard-work.
There are many free code hosting sites for Git and some of them also provide private repositories. I use bitbucket for my projects.
There is another option for private repositories which is Git on Dropbox,
This answer here will help you with this: using-git-and-dropbox-together-effectively.
If you decide to create a repository only on local machine, then here are the steps,
mkdir /c/GIT cd /c/GIT/ git init --bare myproject.git cd /c/xampp/www/myproject/ git init git add . git commit -m "first commit" git remote add origin /c/GIT/myproject.git git push -u origin master
Now, you can start working on your project in C:\xampp\www\myproject\ folder.
To create and switched to a new branch use,
git checkout -b new_branch
which is shorthand for
git branch new_branch git checkout new_branch
You cannot clone the directory , If you want to create the git repo locally only. In order to create a new git repository use ‘git init ‘command.