Skip to content

Instantly share code, notes, and snippets.

@Znow
Forked from bsodmike/gist:2399719
Created April 16, 2012 16:12
Show Gist options
  • Save Znow/2399733 to your computer and use it in GitHub Desktop.
Save Znow/2399733 to your computer and use it in GitHub Desktop.
Agile Git Workflow

First fetch origin

mdesilva@mbpi7 [06:45:00] abtion/exact {ruby-1.9.2@rails32x} [development] 
-> % git fo
remote: Counting objects: 29, done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 20 (delta 16), reused 0 (delta 0)
Unpacking objects: 100% (20/20), done.
From psi.abtion.com:clientele/exact
   4f85784..159d19c  development -> origin/development

Switch to development and pull in upstream commits

mdesilva@mbpi7 [07:04:14] abtion/exact {ruby-1.9.2@rails32x} [wip] 
-> % git co development
Switched to branch 'development'
Your branch is behind 'origin/development' by 2 commits, and can be fast-forwarded.

mdesilva@mbpi7 [07:04:17] abtion/exact {ruby-1.9.2@rails32x} [development] 
-> % git pull
Updating 4f85784..159d19c
Fast-forward
 app/assets/stylesheets/custom.css        |   10 +++++++++-
 app/views/admin/shared/_sidebar.html.erb |   12 ++++++------
 2 files changed, 15 insertions(+), 7 deletions(-)

Switch to wip branch and rebase my work on top of changes just pulled in

mdesilva@mbpi7 [07:04:26] abtion/exact {ruby-1.9.2@rails32x} [development] 
-> % git co wip
Switched to branch 'wip'

mdesilva@mbpi7 [07:04:29] abtion/exact {ruby-1.9.2@rails32x} [wip] 
-> % git rebase development
First, rewinding head to replay your work on top of it...
Applying: update rake task to perform full-import in production

Switch back to development and fast-forward merge with wip

mdesilva@mbpi7 [07:04:33] abtion/exact {ruby-1.9.2@rails32x} [wip] 
-> % git co development
Switched to branch 'development'

mdesilva@mbpi7 [07:04:38] abtion/exact {ruby-1.9.2@rails32x} [development] 
-> % git merge wip
Updating 159d19c..4f35b38
Fast-forward
 app/models/contractor.rb                   |    6 +++---
 app/views/admin/contractors/index.html.erb |    4 +++-
 lib/tasks/csv_import_client_data.rake      |   14 ++++++--------
 3 files changed, 12 insertions(+), 12 deletions(-)

Push a neat linear-history to the remote

mdesilva@mbpi7 [07:04:43] abtion/exact {ruby-1.9.2@rails32x} [development] 
-> % git st
# On branch development
# Your branch is ahead of 'origin/development' by 1 commit.
#
nothing to commit (working directory clean)

mdesilva@mbpi7 [07:05:58] abtion/exact {ruby-1.9.2@rails32x} [development] 
-> % git push
Counting objects: 23, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (12/12), done.
Writing objects: 100% (12/12), 1.12 KiB, done.
Total 12 (delta 10), reused 0 (delta 0)
To vcs@psi.abtion.com:clientele/exact/
  159d19c..4f35b38  development -> development
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment