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.

  • Are you supposed to check-in R.java file in to VCS?
  • fatal: did you run git update-server-info on the server? - Not using github
  • MongoDB database on git repository
  • Ansible sudo_user not using the correct $HOME directory
  • git branch vs $(git branch)
  • Git submodules best practice - always use ssh protocol over https?
  • Commit SVN working copy into Git repository
  • What's the difference between “git fetch <url>” and “git add remote upstream <url>” followed by “git fetch upstream”?
  • Find added files in index before an initial commit is made
  • Cleanup small commits on master branch
  • How to revert a Git Submodule pointer to the commit stored in the containing repository?
  • How to get mongrel working with bundler?
  • 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.

    Git Baby is a git and github fan, let's start git clone.