Articles

Remotely Create a New Git Repo

# ~/.bashrc: executed by bash(1) for non-login shells.
export PATH="$HOME/bin:$HOME/lib/bin:$PATH"
export LC_CTYPE=en_US.UTF-8
# Original "newgit" by CRAIG P JOLICOEUR
# Found at
# http://autopragmatic.com/2008/01/26/hosting-a-git-repository-on-dreamhost/
# http://craigjolicoeur.com/2008/04/hosting-git-repositories-on-dreamhost/
newgit()
{
if [ -z $1 ]; then
echo "usage: $FUNCNAME project-name.git"
else
gitdir="$HOME/Projects/git/$1"
mkdir -p $gitdir
pushd $gitdir
git --bare init
git --bare update-server-info
chmod a+x hooks/post-update
touch git-daemon-export-ok
chmod -R o-r ./
popd
echo "ssh://$USER@subtlegradient.com$gitdir"
fi
}
stage()
{
if [ -z $1 ]; then
echo "usage: $FUNCNAME project-name"
else
gitdir="$HOME/Sites/projects.subtlegradient.com/$1"
mkdir -p $gitdir
pushd $gitdir
git init
git update-server-info
cp "$HOME/lib/git-post-update-stage" "$gitdir/.git/hooks/post-update"
chmod a+x "$gitdir/.git/hooks/post-update"
chmod -R o-r .git/
popd
echo "ssh://$USER@subtlegradient.com$gitdir"
fi
}
view raw bashrc.sh hosted with ❤ by GitHub
This is also partly a trial of the https://gist.github.com embedding.

Related Articles

  • 29 Jul 2009 CSS Position Fixed for IE6
  • 23 Jul 2009 Subtle Hover CSS Inspect Bookmarklet
  • 22 Jun 2009 Replace document.write using MooTools
  • 21 Jun 2009 Testing a way to post to my blog quickly
  • 21 Jun 2009 Jekyll quick post shell script
  • 09 Apr 2009 Blazing fast Semantic JS Templating with edit-in-place templates!
  • 07 Mar 2009 SubtleClickAll Bookmarklet
  • 05 Dec 2008 MooTools databinding plugins coming soon
  • 25 Oct 2008 Tabs or Spaces?
  • 20 Oct 2008 How to have a box default to hidden and then fade it in later
Thomas Aylott Polaroid
SubtleGradient
  • GitHub
  • X (née Twitter)
  • LinkedIn
  • YouTube
  • OpenSea
  • Facebook
  • Blog
  • Email

Thomas Aylott / subtleGradient