Remote repositories in AFS

AFS Provisioning

If you have never used your AFS space before, you may need to set it up. You can do this by visiting mfile.umich.edu and using the self provisioning tool. It may take a few hours to be created.

If you ssh to login.itd.umich.edu and have a home directory you already AFS space and are ready to go.

Set up the remote

The server side directory, wherever it resides, needs to be set up as a bare repository.

Here’s how we can do this for AFS:

  1. login to the remote server: ssh user@login.itd.umich.edu

  2. Create a directory for your git remotes: mkdir git_remotes

  3. Make a project directory, say 506: mkdir git_remotes/506.git

  4. Move to the project directory and set it up as bare:
    • cd git_remotes/506.git
    • git init --bare

To work with the directory, in your AFS space or elsewhere, clone the remote, add and commit files, push and pull.

  1. Move to the parent folder where you’d like the 506 directory to be.
    • cd
    • mkdir git
    • cd git
  2. Clone the repository. Replace uniquename with your unique name, and “u” and “n” with its first two letters (i.e. /afs/umich.edu/user/j/b/jbhender/).

    • From a server with your AFS space mounted: git clone /afs/umich.edu/user/u/n/uniqename/git_remotes/506.git

    • From a shell on another computer, say your laptop:

    git clone ssh://uniqname@login.itd.umich.edu:/afs/umich.edu/user/u/n/uniqename/git_remotes/506.git

  3. Add some files, start with a README.
    • cd 506
    • echo "## About" > README.md
    • git add REAMDE.md && git commit -m "Initial commit."
    • git push -u origin master
  4. You could also create your files locally, initialize and then push to the remote. Repeat steps 3 & 4 to create a bare repository called personal.

    • cd ~/git/
    • mkdir personal
    • git init
    • cp ~/git/506/README.md ./
    • git add REAMDE.md && git commit REAMDE.md -m "Initial commit."
    • git remote add origin ssh://uniqname@login.itd.umich.edu:/afs/umich.edu/user/u/n/uniqename/remotes/personal.git/
    • git push -u origin master

Step 8 will also work with remotes set up through a web interface with third party repository services such as Bitbucket or GitHub.

Videos:

1 of 2 http://www.screencast.com/t/7qATwZEhtP7i

2 of 2 http://www.screencast.com/t/gIsac0jkqhY