Skip to content

Instantly share code, notes, and snippets.

@jharjono
Created September 27, 2011 01:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jharjono/1244102 to your computer and use it in GitHub Desktop.
Save jharjono/1244102 to your computer and use it in GitHub Desktop.
Create git servers on CDF
#!/bin/bash
# This script creates a git repository on your local machine and your CDF account and links them together
# Set up env
REPO_NAME=myproj # or $1 if you want to run this script often
CDF_NAME=g1someone
SERVER=redwolf.cdf.toronto.edu
# Creating the project
mkdir $REPO_NAME
cd $REPO_NAME
git init
# git does not seem to like empty repositories
touch README
git add README
git commit -m "initial commit"
# Create the bare git repo
cd ..
git clone --bare $REPO_NAME ${REPO_NAME}.git
# now move it to CDF
scp -r ${REPO_NAME}.git ${CDF_NAME}@${SERVER}:~/
# and it's live!
cd /tmp
git clone ${CDF_NAME}@${SERVER}:~/${REPO_NAME}.git ${REPO_NAME}-clone
# now you can go to the clone, commit, pull, push, etc
@meatcar
Copy link

meatcar commented Sep 27, 2011

Should probably include a #!/bin/... at the top.

@jharjono
Copy link
Author

duly noted, thanks @meatcar!

@jshyeung
Copy link

They actually let us create GIT repository?

@jharjono
Copy link
Author

jharjono commented Sep 28, 2011 via email

@maximmai
Copy link

Good job Johan, it's very helpful! thanks @jharjono

@jshyeung
Copy link

jshyeung commented Oct 1, 2011

Yep is wonderful. Last time I checked CDF blocked almost everything, but I guess git can use the https ports

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment