Skip to content
Snippets Groups Projects
Select Git revision
  • master default
1 result

git-clone-fail-demo

  • Clone with SSH
  • Clone with HTTPS
  • user avatar
    Per Cederqvist authored
    f84426b3
    History
    The scripts in this directory demonstrates a problem with git: "git
    clone" may fail if somebody pushes changes to the repository while you
    are cloning it.  This is true for at least repositories accessed via
    ssh and and local repositories.  I've tested local access with Git
    1.6.0, 1.7.9 and 1.7.10.  ssh access has only been tested with Git
    1.7.10.
    
    To test local access, run this command which creates the test-git
    directory and creates some test data in it:
    
        ./test-git-setup.sh
    
    Then run these four commands at the same time, preferably in separate
    windows so that you can see their output:
    
          ./test-git-reclone.sh master
          ./test-git-reclone.sh mirror
          ./test-git-mirror.sh
          ./test-git-commit.sh
    
    The commands should run forever (or until your disk fills up).  But
    the test-git-reclone command exits after a while.  The stdout and
    stderr from the "git clone" command is available in the
    test-git/master.out, test-git/master.err, test-git/mirror.out and
    test-git/mirror.err files.
    
    To test via ssh, kill all the scripts, run this:
    
        ./test-git-setup.sh --use-ssh
    
    and then restart the four test scripts.  This assumes that you have
    things set up so that you can log in to localhost via ssh.  To avoid
    locking errors from xauth, you should add these lines to the top of
    .ssh/config while you are running this:
    
    Host localhost
      ForwardX11 no
      ForwardX11Trusted no
    
    When using the local protocol, the reclone script often fails after
    just a few attempts, and I have never seen it handle more than 400
    clones without getting an error.  When using ssh it is a lot harder to
    trigger the problem.  I have only seen it 3 times out of more than
    4000 attempts.