Skip to content

Instantly share code, notes, and snippets.

@gerjantd
gerjantd / gist:2436695
Created April 21, 2012 11:27
Git: simple branch and merge example
git clone https://[email protected]/gerjantd/foo.git
cd foo
gitk
vi bugfix1
git status
git add bugfix1
git status
gitk
git commit -m "Added bugfix1"
gitk
@gerjantd
gerjantd / gist:2436691
Created April 21, 2012 11:26
Git: reset to previous commit
1. git clone https://[email protected]/gerjantd/foo.git
2. cd foo
3. git log --pretty=oneline
ed63ee6e036f1a0093e0b5b42a63a37ab69e4bc4 Merge branch 'master' into harebrained
f48e2f81555b4bbefb40e262da4d83d6814b80ea Added bugfix2
34290bce3f0fda000195eaf7fa2fc197d8e872de Added crazy and silly
dc2e9d8e358b1693d3374fb5452e434ef788a940 Added bugfix1
228662ad192fae2b4736b8bba3d7566fc201a74c Redirecting
@gerjantd
gerjantd / gist:2436686
Created April 21, 2012 11:24
Github: fork your own repo
http://bitdrift.com/post/4534738938/fork-your-own-project-on-github
1. Create a new repo named bar at github.com
2. git clone https://[email protected]/gerjantd/foo.git bar
3. cd bar
4. vi .git/config
replace foo with bar
@gerjantd
gerjantd / gist:2401548
Created April 16, 2012 21:13
My Git Workflow
http://osteele.com/archives/2008/05/my-git-workflow
My Git Workflow
Git‘s great! But it’s difficult to learn (it was for me, anyway) — especially the index, which unlike the power-user features, comes up in day-to-day operation.
Here’s my path to enlightment, and how I ended up using the index in my particular workflow. There are other workflows, but this one is mine.
What this isn’t: a Git tutorial. It doesn’t tell you how to set up git, or use it. I don’t cover branches, or merging, or tags, or blobs. There are dozens of really great articles about Git on the web; here are some. What’s here are just some pictures that aren’t about branches or blobs, that I wished I’d been able to look at six months ago when I was trying to figure this stuff out; I still haven’t seen them elsewhere, so here they are now.
@gerjantd
gerjantd / cmd.sh
Created April 15, 2012 07:41
Subversion: how to get all changed files between two revisions
#!/bin/sh
svn log -vqr x:y | egrep '^ +[ADM] ' | sort | uniq