Skip to content

Instantly share code, notes, and snippets.

@danielnolan
Forked from lgmkr/git-rebase.markdown
Last active January 28, 2019 15:36
Show Gist options
  • Save danielnolan/6cb0fe716cc7cf2774039b9f74647d9b to your computer and use it in GitHub Desktop.
Save danielnolan/6cb0fe716cc7cf2774039b9f74647d9b to your computer and use it in GitHub Desktop.

Revisions

  1. danielnolan revised this gist Jan 28, 2019. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion git-rebase.markdown
    Original file line number Diff line number Diff line change
    @@ -9,8 +9,13 @@
    git checkout <branchname>
    git rebase origin/develop

    ### Squash Last N Commits ###
    ### Squash Last N Commits Against Develop ###
    git rebase --interactive origin/develop
    ### Squash Last N Commits Locally Without Pulling In Upstream Changes From Develop ###
    git rebase -i HEAD~<n>
    or
    git rebase -i <after-this-commit-sha1>

    ### Conflicts ###
    1. Resolve conflict my looking at the files in question.
  2. danielnolan revised this gist Jan 15, 2019. 1 changed file with 3 additions and 12 deletions.
    15 changes: 3 additions & 12 deletions git-rebase.markdown
    Original file line number Diff line number Diff line change
    @@ -2,26 +2,17 @@
    git checkout -b <branchname>

    ### Make Changes ###

    git add
    git commit -m "description of changes"

    ### Sync with remote ###

    git checkout develop
    git pull --rebase
    git commit

    ### Update branch ###

    git checkout <branchname>
    git rebase develop
    git rebase origin/develop

    ### Squash Last N Commits ###

    git rebase --interactive HEAD~N
    git rebase --interactive origin/develop

    ### Conflicts ###

    1. Resolve conflict my looking at the files in question.
    2. git add <resolved files>
    3. git rebase --continue
  3. danielnolan revised this gist Jan 15, 2019. 1 changed file with 2 additions and 19 deletions.
    21 changes: 2 additions & 19 deletions git-rebase.markdown
    Original file line number Diff line number Diff line change
    @@ -8,19 +8,13 @@

    ### Sync with remote ###

    git checkout master
    git checkout develop
    git pull --rebase

    ### Update branch ###

    git checkout <branchname>
    git rebase master

    ### Push Changes ###

    git checkout master
    git merge <branchname>
    git push
    git rebase develop

    ### Squash Last N Commits ###

    @@ -31,14 +25,3 @@
    1. Resolve conflict my looking at the files in question.
    2. git add <resolved files>
    3. git rebase --continue

    ### Git Flow ###

    git flow init # setup project to use git-flow

    git flow feature start <feature_name> # creates a new feature branch called <feature_name>

    git flow feature finish <feature_name> # merge feature back into develop branch

    git flow release start <version> # merge develop to release

  4. @tmcgilchrist tmcgilchrist revised this gist Jun 7, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion git-rebase.markdown
    Original file line number Diff line number Diff line change
    @@ -34,7 +34,7 @@

    ### Git Flow ###

    git flow init # Setup project to use git-flow
    git flow init # setup project to use git-flow

    git flow feature start <feature_name> # creates a new feature branch called <feature_name>

  5. @tmcgilchrist tmcgilchrist revised this gist Jun 7, 2012. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions git-rebase.markdown
    Original file line number Diff line number Diff line change
    @@ -32,3 +32,13 @@
    2. git add <resolved files>
    3. git rebase --continue

    ### Git Flow ###

    git flow init # Setup project to use git-flow

    git flow feature start <feature_name> # creates a new feature branch called <feature_name>

    git flow feature finish <feature_name> # merge feature back into develop branch

    git flow release start <version> # merge develop to release

  6. @tmcgilchrist tmcgilchrist revised this gist May 18, 2012. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions git-rebase.markdown
    Original file line number Diff line number Diff line change
    @@ -22,6 +22,10 @@
    git merge <branchname>
    git push

    ### Squash Last N Commits ###

    git rebase --interactive HEAD~N

    ### Conflicts ###

    1. Resolve conflict my looking at the files in question.
  7. @tmcgilchrist tmcgilchrist revised this gist Feb 10, 2012. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions git-rebase.markdown
    Original file line number Diff line number Diff line change
    @@ -1,18 +1,23 @@
    ### Checkout a new working branch ###
    git checkout -b <branchname>

    ### Make Changes ###

    git add
    git commit -m "description of changes"

    ### Sync with remote ###

    git checkout master
    git pull --rebase

    ### Update branch ###

    git checkout <branchname>
    git rebase master

    ### Push Changes ###

    git checkout master
    git merge <branchname>
    git push
  8. @tmcgilchrist tmcgilchrist revised this gist Feb 10, 2012. 1 changed file with 10 additions and 10 deletions.
    20 changes: 10 additions & 10 deletions git-rebase.markdown
    Original file line number Diff line number Diff line change
    @@ -1,21 +1,21 @@
    git checkout -b <branchname>
    git checkout -b <branchname>

    ### Make Changes ###
    git add
    git commit -m "description of changes"
    git add
    git commit -m "description of changes"

    ### Sync with remote ###
    git checkout master
    git pull --rebase
    git checkout master
    git pull --rebase

    ### Update branch ###
    git checkout <branchname>
    git rebase master
    git checkout <branchname>
    git rebase master

    ### Push Changes ###
    git checkout master
    git merge <branchname>
    git push
    git checkout master
    git merge <branchname>
    git push

    ### Conflicts ###

  9. @tmcgilchrist tmcgilchrist created this gist Feb 10, 2012.
    25 changes: 25 additions & 0 deletions git-rebase.markdown
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    git checkout -b <branchname>

    ### Make Changes ###
    git add
    git commit -m "description of changes"

    ### Sync with remote ###
    git checkout master
    git pull --rebase

    ### Update branch ###
    git checkout <branchname>
    git rebase master

    ### Push Changes ###
    git checkout master
    git merge <branchname>
    git push

    ### Conflicts ###

    1. Resolve conflict my looking at the files in question.
    2. git add <resolved files>
    3. git rebase --continue