wiki:faq/git

Version 6 (modified by Jamie McClelland, 9 years ago) (diff)

--

Does May First/People Link have a shared git installation I can use?

Yes. If you would like access to it, please start by opening a ticket. Include:

  • your public ssh key
  • The name of the project you would like to setup (please try to make the name specific)
  • Whether you want to enable public access or not

Once we've completed the setup, you can use your repository by taking the following steps:

  • Create a bare repository on your development machine:
    mkdir myproject
    cd myproject
    git init
    
  • Next, add a file or two
    touch README
    git add README
    git commit README
    
  • Next add the MFPL git repo as a remote:
    git remote add origin gitosis@git.mayfirst.org:myproject.git
    
  • And then the moment of truth:
    git push origin master:refs/heads/master
    
  • If you don't want to specify origin master:refs/heads/master every time you want to push, you can edit your .git/config file and copy the fetch line in the origin stanza, replacing fetch with push. For example:
    [remote "origin"]
      url = gitosis@git.mayfirst.org:myproject.git
      fetch = +refs/heads/*:refs/remotes/origin/*
      push = +refs/heads/*:refs/remotes/origin/*