Skip to content

rebase danger #2

Description

@c8y3

git init
echo 'hello\nworld' > file.txt
git add file.txt
git commit -m 'initial'
echo a > requirements.txt
git add requirements.txt
git commit -m "requirements"

git switch -c feature
echo again >> file.txt
echo b >> requirements.txt
git add file.txt requirements.txt
git commit -m "Adding many"
echo a > requirements.txt
git add requirements.txt
git commit -m "Removing some"

git switch master
echo b >> requirements.txt
git add requirements.txt
git commit -m "Adding some"
echo a > requirements.txt
git add requirements.txt
git commit -m "Removing all"

git show | git patch-id
git switch feature
git show | git patch-id

git rebase -i master

b is present in requirements.txt
when it is not present in either of the branches before rebase!!
(the commit is not even presented when doing git rebase --interactive! because it has the same patch-id
git show | git patch-id)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions