how to use git clone for two developers

I use git for my local project in Linux where I’m only one person. I would like to share my project with other person who is on the another machine using Windows. How could I do that?

I have a book about git but still could not figure out how to handle that. For example, it says that the other user could type:

  • Using vim for git commit messages broken after updating janus
  • git push to GitHub repository branch gives error “src refspec master does not match any”
  • Adding folders to .gitignore
  • Discard all changes in Xcode 4.2
  • How to install Github on USB Drive?
  • Deployment of Continuous Integration Infrastructure
  • git clone my.ip.add.ress:/home/myuser/projects/myproject

    But when this person does it, it asks password for his user in my machine. I did not register any other users on my machine except myself. Of course I can:

    1. Register new user in my linux (adduser),
    2. Create link in user directory to my project
    3. Configure permissions for my project’s folder to be readeable for this user

    and then this user (developer2) could perform command like:


    but I guess it’s not a nice solution.

  • How to restore the aborted or interrupted “git clone”?
  • Any benefit to fork repo when I have write access?
  • How to prevent tracked config files from being changed by merges in git?
  • How to create chef cookbook in git repository?
  • Squash to only one “proper” commit for github pull request
  • Git repository without history
  • 2 Solutions collect form web for “how to use git clone for two developers”

    The simplest way of doing that is to use file system based access.

    I.e. your second developer can do:

    git clone /home/users/developer1/repos/project

    In this case he will not be able to push to your repository but if he can read he will be able to establish the connection and pull from you. when he will contribute his part – you will pull from him

    git remote add dev2 /home/users/developer2/repos/project
    git fetch dev2

    and so on…

    second variant is to run git-daemon

    /usr/local/git/bin/git daemon --reuseaddr --export-all --base-path=/home/users/dev1/repos

    You can use --enable=receive-pack to give him an ability to push to your repo if needed. This is not recommended in open network or on public repos, but inside firewalled network it is totally fine i think

    1. start git-daemon to share your repository
    2. have the other guy do git clone git://your.ip.address/your-project

    He won’t need to authenticate to git-daemon.

    Here’s a link to how it’s done (and seven other ways to do it).

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