reminder. git. awesome.

posted by alexis reigel on july 19, 2012

This is just a quick reminder of how awesome git actually is. The story is short:

My disk crashed and I lost a couple of local commits that I hadn’t pushed (to github) yet. Luckily, I deployed them to the staging server already (actually, this is a reminder of how awesome git and capistrano actually are). Because capistrano is awesome and deploys the git repo to the server, and git is awesome too, I could restore my local repo from the staging server:

local:  $ ssh staging_server
server: $ # some `cd` action
server: $ tar czf asdf.tgz www_folder
server: $ # ctrl + D
local:  $ cd /tmp
local:  $ scp user@staging_server:/tmp/asdf.tgz .
local:  $ tar xf asdf.tgz
local:  $ cd my_local_repo
local:  $ git pull /tmp/asdf dev

A simple git pull from the copied repo and I’m all set again.

How awesome is your dev stack?

commented by Nargs on september 12, 2013

Great tip, thanks!Maybe avoid an aniedcctal push (nah, no idea how that could happen), one could usegit config global url.git:// gnome:this way you get access to the read only versionAlso to my big surprise i found out how good the tab-autocompletition in command line works try it out!