Skip to content

Instantly share code, notes, and snippets.

@santisbon
Last active September 28, 2025 09:25
Show Gist options
  • Save santisbon/a1a60db1fb8eecd1beeacd986ae5d3ca to your computer and use it in GitHub Desktop.
Save santisbon/a1a60db1fb8eecd1beeacd986ae5d3ca to your computer and use it in GitHub Desktop.

Revisions

  1. santisbon revised this gist Jul 21, 2025. No changes.
  2. santisbon revised this gist Mar 17, 2023. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions Update-branch.md
    Original file line number Diff line number Diff line change
    @@ -1,17 +1,17 @@
    # Updating a feature branch

    First we'll update your local `master` branch. Go to your local project and check out the branch you want to merge into (your local master branch)
    First we'll update your local `master` branch. Go to your local project and check out the branch you want to merge into (your local `master` branch)
    ```bash
    $ git checkout master
    ```

    Fetch the remote, bringing the branches and their commits from the remote repository.
    You can use the -p, --prune option to delete any remote-tracking references that no longer exist in the remote. Commits to master will be stored in a local branch, remotes/origin/master
    You can use the `-p`, `--prune` option to delete any remote-tracking references that no longer exist in the remote. Commits to `master` will be stored in a local branch, `remotes/origin/master`.
    ```bash
    $ git fetch -p origin
    ```

    Merge the changes from origin/master into your local master branch. This brings your master branch in sync with the remote repository, without losing your local changes. If your local branch didn't have any unique commits, Git will instead perform a "fast-forward".
    Merge the changes from `origin/master` into your local `master` branch. This brings your `master` branch in sync with the remote repository, without losing your local changes. If your local branch didn't have any unique commits, Git will instead perform a "fast-forward".
    ```bash
    $ git merge origin/master
    ```
    @@ -21,7 +21,7 @@ Check out the branch you want to merge into
    $ git checkout <feature-branch>
    ```

    Merge your (now updated) master branch into your feature branch to update it with the latest changes from your team.
    Merge your (now updated) `master` branch into your feature branch to update it with the latest changes from your team.
    ```bash
    $ git merge master
    ```
  3. santisbon revised this gist Mar 17, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Update-branch.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Updating a feature branch

    First we'll update your local master branch. Go to your local project and check out the branch you want to merge into (your local master branch)
    First we'll update your local `master` branch. Go to your local project and check out the branch you want to merge into (your local master branch)
    ```bash
    $ git checkout master
    ```
  4. santisbon revised this gist Mar 16, 2023. No changes.
  5. santisbon revised this gist Apr 2, 2020. No changes.
  6. santisbon revised this gist Jun 1, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Update-branch.md
    Original file line number Diff line number Diff line change
    @@ -26,7 +26,7 @@ Merge your (now updated) master branch into your feature branch to update it wit
    $ git merge master
    ```

    Depending on your git configuration this may open vim. Enter a commit message, save, and quit vim e.g.
    Depending on your git configuration this may open vim. Enter a commit message, save, and quit vim:
    1. Press `a` to enter insert mode and append text following the current cursor position.
    2. Press the **esc** key to enter command mode.
    3. Type `:wq` to write the file to disk and quit.
  7. santisbon revised this gist Jun 1, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Update-branch.md
    Original file line number Diff line number Diff line change
    @@ -27,7 +27,7 @@ $ git merge master
    ```

    Depending on your git configuration this may open vim. Enter a commit message, save, and quit vim e.g.
    1. Press `a` to enter insert mode and append text following current cursor position.
    1. Press `a` to enter insert mode and append text following the current cursor position.
    2. Press the **esc** key to enter command mode.
    3. Type `:wq` to write the file to disk and quit.

  8. santisbon revised this gist Jun 1, 2019. No changes.
  9. santisbon revised this gist Jun 1, 2019. No changes.
  10. santisbon revised this gist Jun 1, 2019. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Update-branch.md
    Original file line number Diff line number Diff line change
    @@ -27,9 +27,9 @@ $ git merge master
    ```

    Depending on your git configuration this may open vim. Enter a commit message, save, and quit vim e.g.
    1. Press **a** to enter insert mode and append text following current cursor position.
    1. Press `a` to enter insert mode and append text following current cursor position.
    2. Press the **esc** key to enter command mode.
    3. Type **:wq** to write the file to disk and quit.
    3. Type `:wq` to write the file to disk and quit.

    This only updates your local feature branch. To update it on GitHub, push your changes.
    ```bash
  11. santisbon revised this gist Jun 1, 2019. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions Update-branch.md
    Original file line number Diff line number Diff line change
    @@ -27,9 +27,9 @@ $ git merge master
    ```

    Depending on your git configuration this may open vim. Enter a commit message, save, and quit vim e.g.
    1. Press "a" to enter insert mode and append text following current cursor position.
    2. Press the esc key to enter command mode.
    3. Press :wq to write the file to disk and quit.
    1. Press **a** to enter insert mode and append text following current cursor position.
    2. Press the **esc** key to enter command mode.
    3. Type **:wq** to write the file to disk and quit.

    This only updates your local feature branch. To update it on GitHub, push your changes.
    ```bash
  12. santisbon revised this gist Jun 1, 2019. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion Update-branch.md
    Original file line number Diff line number Diff line change
    @@ -26,7 +26,10 @@ Merge your (now updated) master branch into your feature branch to update it wit
    $ git merge master
    ```

    Depending on your git configuration this may open vim. Enter a commit message, save, and quit vim e.g. press "a" to enter insert mode and append text following current cursor position, press Esc key to enter command mode, press :wq to write the file to disk and quit.
    Depending on your git configuration this may open vim. Enter a commit message, save, and quit vim e.g.
    1. Press "a" to enter insert mode and append text following current cursor position.
    2. Press the esc key to enter command mode.
    3. Press :wq to write the file to disk and quit.

    This only updates your local feature branch. To update it on GitHub, push your changes.
    ```bash
  13. asantisbon revised this gist Jun 2, 2016. 1 changed file with 1 addition and 4 deletions.
    5 changes: 1 addition & 4 deletions Update-branch.md
    Original file line number Diff line number Diff line change
    @@ -26,10 +26,7 @@ Merge your (now updated) master branch into your feature branch to update it wit
    $ git merge master
    ```

    Depending on your git configuration this may open vim. Enter a commit message, save, and quit vim e.g.
    Press "a" to enter insert mode and append text following current cursor position
    Press Esc key to enter command mode
    Press :wq to write the file to disk and quit
    Depending on your git configuration this may open vim. Enter a commit message, save, and quit vim e.g. press "a" to enter insert mode and append text following current cursor position, press Esc key to enter command mode, press :wq to write the file to disk and quit.

    This only updates your local feature branch. To update it on GitHub, push your changes.
    ```bash
  14. asantisbon revised this gist Jun 2, 2016. No changes.
  15. asantisbon revised this gist Jun 2, 2016. 1 changed file with 6 additions and 5 deletions.
    11 changes: 6 additions & 5 deletions Update-branch.md
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,14 @@
    # Updating a feature branch
    First we'll update your local master branch. Go to your local project and fetch the remote, bringing the branches and their commits from the remote repository.
    You can use the -p, --prune option to delete any remote-tracking references that no longer exist in the remote. Commits to master will be stored in a local branch, remotes/origin/master

    First we'll update your local master branch. Go to your local project and check out the branch you want to merge into (your local master branch)
    ```bash
    $ git fetch -p origin
    $ git checkout master
    ```

    Check out the branch you want to merge into (your local master branch)
    Fetch the remote, bringing the branches and their commits from the remote repository.
    You can use the -p, --prune option to delete any remote-tracking references that no longer exist in the remote. Commits to master will be stored in a local branch, remotes/origin/master
    ```bash
    $ git checkout master
    $ git fetch -p origin
    ```

    Merge the changes from origin/master into your local master branch. This brings your master branch in sync with the remote repository, without losing your local changes. If your local branch didn't have any unique commits, Git will instead perform a "fast-forward".
  16. asantisbon revised this gist Jun 1, 2016. 2 changed files with 36 additions and 26 deletions.
    36 changes: 36 additions & 0 deletions Update-branch.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,36 @@
    # Updating a feature branch
    First we'll update your local master branch. Go to your local project and fetch the remote, bringing the branches and their commits from the remote repository.
    You can use the -p, --prune option to delete any remote-tracking references that no longer exist in the remote. Commits to master will be stored in a local branch, remotes/origin/master
    ```bash
    $ git fetch -p origin
    ```

    Check out the branch you want to merge into (your local master branch)
    ```bash
    $ git checkout master
    ```

    Merge the changes from origin/master into your local master branch. This brings your master branch in sync with the remote repository, without losing your local changes. If your local branch didn't have any unique commits, Git will instead perform a "fast-forward".
    ```bash
    $ git merge origin/master
    ```

    Check out the branch you want to merge into
    ```bash
    $ git checkout <feature-branch>
    ```

    Merge your (now updated) master branch into your feature branch to update it with the latest changes from your team.
    ```bash
    $ git merge master
    ```

    Depending on your git configuration this may open vim. Enter a commit message, save, and quit vim e.g.
    Press "a" to enter insert mode and append text following current cursor position
    Press Esc key to enter command mode
    Press :wq to write the file to disk and quit

    This only updates your local feature branch. To update it on GitHub, push your changes.
    ```bash
    $ git push origin <feature-branch>
    ```
    26 changes: 0 additions & 26 deletions Update-branch.sh
    Original file line number Diff line number Diff line change
    @@ -1,26 +0,0 @@
    # First we'll update your local master branch
    # cd into your local project and fetch the remote, bringing the branches and their commits from the remote repository.
    # You can use the -p, --prune option to delete any remote-tracking references that no longer exist in the remote.
    # Commits to master will be stored in a local branch, remotes/origin/master
    git fetch -p origin

    # check out the branch you want to merge into (your local master branch)
    git checkout master

    # Merge the changes from origin/master into your local master branch.
    # This brings your master branch in sync with the remote repository, without losing your local changes.
    # If your local branch didn't have any unique commits, Git will instead perform a "fast-forward".
    git merge origin/master

    # Check out the branch you want to merge into
    git checkout <feature-branch>

    # Merge your (now updated) master branch into your feature branch to update it with the latest changes from your team.
    git merge master
    # Depending on your git configuration this may open vim. Enter a commit message, save, and quit vim e.g.
    # Press "a" to enter insert mode and append text following current cursor position
    # Press Esc key to enter command mode
    # Press :wq to write the file to disk and quit

    # This only updates your local feature branch. To update it on GitHub, push your changes.
    git push origin <feature-branch>
  17. asantisbon revised this gist May 30, 2016. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions Update-branch.sh
    Original file line number Diff line number Diff line change
    @@ -17,6 +17,10 @@ git checkout <feature-branch>

    # Merge your (now updated) master branch into your feature branch to update it with the latest changes from your team.
    git merge master
    # Depending on your git configuration this may open vim. Enter a commit message, save, and quit vim e.g.
    # Press "a" to enter insert mode and append text following current cursor position
    # Press Esc key to enter command mode
    # Press :wq to write the file to disk and quit

    # This only updates your local feature branch. To update it on GitHub, push your changes.
    git push origin <feature-branch>
  18. asantisbon revised this gist May 29, 2016. No changes.
  19. asantisbon revised this gist May 29, 2016. No changes.
  20. asantisbon created this gist May 29, 2016.
    22 changes: 22 additions & 0 deletions Update-branch.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    # First we'll update your local master branch
    # cd into your local project and fetch the remote, bringing the branches and their commits from the remote repository.
    # You can use the -p, --prune option to delete any remote-tracking references that no longer exist in the remote.
    # Commits to master will be stored in a local branch, remotes/origin/master
    git fetch -p origin

    # check out the branch you want to merge into (your local master branch)
    git checkout master

    # Merge the changes from origin/master into your local master branch.
    # This brings your master branch in sync with the remote repository, without losing your local changes.
    # If your local branch didn't have any unique commits, Git will instead perform a "fast-forward".
    git merge origin/master

    # Check out the branch you want to merge into
    git checkout <feature-branch>

    # Merge your (now updated) master branch into your feature branch to update it with the latest changes from your team.
    git merge master

    # This only updates your local feature branch. To update it on GitHub, push your changes.
    git push origin <feature-branch>