Skip to content

Instantly share code, notes, and snippets.

@sunsided
Last active February 19, 2024 20:57
Show Gist options
  • Select an option

  • Save sunsided/94dd71b15d6ea994f8523f1af8e049ae to your computer and use it in GitHub Desktop.

Select an option

Save sunsided/94dd71b15d6ea994f8523f1af8e049ae to your computer and use it in GitHub Desktop.

Revisions

  1. sunsided renamed this gist Feb 19, 2024. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. sunsided revised this gist Feb 19, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion tricks.sh
    Original file line number Diff line number Diff line change
    @@ -5,4 +5,4 @@ git merge --allow-unrelated-histories -Xtheirs $ORPHAN_BRANCH
    git diff-tree -r --diff-filter=D --name-only timeline $ORPHAN_BRANCH

    # ... and delete them
    git diff-tree -r --diff-filter=D --name-only timeline $ORPHAN_BRANCH | xargs git rm
    git diff-tree -r --diff-filter=D --name-only timeline $ORPHAN_BRANCH | xargs -d '\n' git rm
  3. sunsided revised this gist Feb 19, 2024. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion tricks.sh
    Original file line number Diff line number Diff line change
    @@ -2,4 +2,7 @@
    git merge --allow-unrelated-histories -Xtheirs $ORPHAN_BRANCH

    # List all files existing in branch "timeline" that do not exist in branch "$ORPHAN_BRANCH"
    git diff-tree -r --diff-filter=D --name-only timeline $ORPHAN_BRANCH
    git diff-tree -r --diff-filter=D --name-only timeline $ORPHAN_BRANCH

    # ... and delete them
    git diff-tree -r --diff-filter=D --name-only timeline $ORPHAN_BRANCH | xargs git rm
  4. sunsided revised this gist Feb 19, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion tricks.sh
    Original file line number Diff line number Diff line change
    @@ -2,4 +2,4 @@
    git merge --allow-unrelated-histories -Xtheirs $ORPHAN_BRANCH

    # List all files existing in branch "timeline" that do not exist in branch "$ORPHAN_BRANCH"
    git diff-tree -r --diff-filter=D timeline $ORPHAN_BRANCH --name-only
    git diff-tree -r --diff-filter=D --name-only timeline $ORPHAN_BRANCH
  5. sunsided revised this gist Feb 19, 2024. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions tricks.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    # Merge an orphan branch and overwrite our changes ("take theirs").
    git merge --allow-unrelated-histories -Xtheirs $ORPHAN_BRANCH

    # List all files existing in branch "timeline" that do not exist in branch "release/1.9.0"
    git diff-tree -r --diff-filter=D timeline release/1.9.0 --name-only
    # List all files existing in branch "timeline" that do not exist in branch "$ORPHAN_BRANCH"
    git diff-tree -r --diff-filter=D timeline $ORPHAN_BRANCH --name-only
  6. sunsided revised this gist Feb 19, 2024. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions tricks.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    # Merge an orphan branch
    git merge --allow-unrelated-histories $ORPHAN_BRANCH
    # Merge an orphan branch and overwrite our changes ("take theirs").
    git merge --allow-unrelated-histories -Xtheirs $ORPHAN_BRANCH

    # List all files existing in branch "timeline" that do not exist in branch "release/1.9.0"
    git diff-tree -r --diff-filter=D timeline release/1.9.0 --name-only
  7. sunsided revised this gist Feb 19, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion tricks.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    # Merge an orphan branch
    git merge --allow-unrelated-histories $orphan_branch>
    git merge --allow-unrelated-histories $ORPHAN_BRANCH

    # List all files existing in branch "timeline" that do not exist in branch "release/1.9.0"
    git diff-tree -r --diff-filter=D timeline release/1.9.0 --name-only
  8. sunsided revised this gist Feb 19, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion tricks.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    # Merge an orphan branch
    git merge --allow-unrelated-histories <orphan-branch>
    git merge --allow-unrelated-histories $orphan_branch>

    # List all files existing in branch "timeline" that do not exist in branch "release/1.9.0"
    git diff-tree -r --diff-filter=D timeline release/1.9.0 --name-only
  9. sunsided revised this gist Feb 19, 2024. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions tricks.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    # Merge an orphan branch
    git merge --allow-unrelated-histories <orphan-branch>

    # List all files existing in branch "timeline" that do not exist in branch "release/1.9.0"
    git diff-tree -r --diff-filter=D timeline release/1.9.0 --name-only
  10. sunsided renamed this gist Feb 19, 2024. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  11. sunsided created this gist Feb 19, 2024.
    3 changes: 3 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@

    # List all files existing in branch "timeline" that do not exist in branch "release/1.9.0"
    git diff-tree -r --diff-filter=D timeline release/1.9.0 --name-only