Git on a USB Stick

less than 1 minute read


Having loads of hassel the with git, ssh and https access to github.com, so i decided to setup git on a usb stick. I can work away during the day and synch to github at night.

I followed this tutorial

http://blog.costan.us/2009/02/synchronizing-git-repositories-without.html

http://swoes.blogspot.com/2009/02/setting-up-git-offline-work-via-usb.html

And these are the basic commands i ran.

mkdir /media/Transcend/git/com_bhaa
git clone –bare . /media/Transcend/git/com_bhaa/.git

git remote add usb file:///media/Transcend/git/com_bhaa/.git

assure@snapdragonubuntu:~/bhaa/zend/trunk/joomla/components/com_bhaa$ git remote -v
usb file:///media/Transcend/git/com_bhaa/.git (fetch)
usb file:///media/Transcend/git/com_bhaa/.git (push)

assure@snapdragonubuntu:~/git/com_bhaa$ git clone file:///media/Transcend/git/com_bhaa/.git .
Cloning into ….
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 6 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (6/6), done.
assure@snapdragonubuntu:~/git/com_bhaa$ ls
index.html  router.php

assure@snapdragonubuntu:~/git/com_bhaa$ git remote add usb file:///media/Transcend/git/com_bhaa/.gitassure@snapdragonubuntu:~/git/com_bhaa$ git pull usb master
From file:///media/Transcend/git/com_bhaa/
 * branch            master     -> FETCH_HEAD
Already up-to-date.
assure@snapdragonubuntu:~/git/com_bhaa$ git remote -v
origin file:///media/Transcend/git/com_bhaa/.git (fetch)
origin file:///media/Transcend/git/com_bhaa/.git (push)
usb file:///media/Transcend/git/com_bhaa/.git (fetch)
usb file:///media/Transcend/git/com_bhaa/.git (push)



git clone –bare . /media/Transcend/git/joomala_bhaa.git

git remote add usb file:///media/Transcend/git/joomala_bhaa.git

assure@snapdragonubuntu:~/poconnell/code/joomla_bhaa$ git remote -v
usb file:///media/Transcend/git/joomala_bhaa.git (fetch)
usb file:///media/Transcend/git/joomala_bhaa.git (push)
assure@snapdragonubuntu:~/poconnell/code/joomla_bhaa$ git push usb
Counting objects: 12, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (11/11), 2.67 KiB, done.
Total 11 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (11/11), done.
To file:///media/Transcend/git/joomala_bhaa.git
   9067f85..dbc96e6  master -> master
<div>
</div>

Categories:

Updated:

Leave a Comment