Skip to content

Instantly share code, notes, and snippets.

@bitliner
Last active October 15, 2020 16:46
Show Gist options
  • Select an option

  • Save bitliner/5332eb12762925b23ae7c97f5a5ee25f to your computer and use it in GitHub Desktop.

Select an option

Save bitliner/5332eb12762925b23ae7c97f5a5ee25f to your computer and use it in GitHub Desktop.

Revisions

  1. bitliner revised this gist Oct 15, 2020. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions git.md
    Original file line number Diff line number Diff line change
    @@ -16,5 +16,9 @@
    - `git reset --hard a1b2c3d4`
    - `git reset --hard HEAD~3` # Go back 3 commits. You *will* lose uncommitted work

    ## Merge commits

    - `git rebase -i HEAD~2` - merge the last 2 commits



  2. bitliner revised this gist Aug 4, 2020. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions git.md
    Original file line number Diff line number Diff line change
    @@ -11,3 +11,10 @@
    - `git stash show` - it makes the list of files of the last stashed patch
    - `git stash show -p` - it shows the diff of the last stashed patch

    ## Remove history

    - `git reset --hard a1b2c3d4`
    - `git reset --hard HEAD~3` # Go back 3 commits. You *will* lose uncommitted work



  3. bitliner revised this gist Aug 4, 2020. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions git.md
    Original file line number Diff line number Diff line change
    @@ -4,3 +4,10 @@

    - **Empty commit** `git commit --allow-empty -m 'fake commit to push' `

    ## Git stash

    - `git stash`
    - `git stash pop` - apply last stashed patch
    - `git stash show` - it makes the list of files of the last stashed patch
    - `git stash show -p` - it shows the diff of the last stashed patch

  4. bitliner created this gist Jun 7, 2020.
    6 changes: 6 additions & 0 deletions git.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    # Git

    ## Commit

    - **Empty commit** `git commit --allow-empty -m 'fake commit to push' `