git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Aborting 'rebase main feat' removes unversioned files

From
Bagas Sanjaya <bagasdotme@gmail.com>
Date
Sep 4, 2021, 06:57 UTC
Message-ID
<dbe7d88d-4174-e080-03df-e35d0ac6004f@gmail.com>
In-Reply-To
<C357A648-8B13-45C3-9388-C0C7F7D40DAE@gmail.com>
On 04/09/21 03.33, Fedor Biryukov wrote:
Show 14 quoted lines
> Looks like a bug in git rebase main feat.
> 
> To reproduce:
> git init
> git commit -m 'init' --allow-empty
> git checkout -b feat
> echo 123 > readme.txt
> git add readme.txt
> git commit -m 'txt=123'
> git checkout main
> echo 012 > readme.txt
> git rebase main feat
> git rebase --abort
> 
Did you forget committing?
Show 7 quoted lines
> Expected result:
> readme.txt contains 012
> 
> Actual result:
> readme.txt contains 123
> 
> According to the docs, git rebase main feat is a shorthand for git checkout feat followed by git rebase main. I have checked that doing checkout and rebase separately instead of using the shorthand does not have the same issue.
I think this is non-issue (behavior as intended).

So when you say `git rebase main feat`, Git will rebase your commits in feat on top of main. If any conflicts occur and you abort rebasing (`git rebase --abort`), your feat branch just looks like before rebasing.

-- 
An old man doll... just what I always wanted! - Clara
Previous: Fedor BiryukovNext: Jeff King
Message 2 of 15 in “Aborting 'rebase main feat' removes unversioned files”
  1. Fedor BiryukovSep 3, 2021
  2. Bagas SanjayaSep 4, 2021
  3. Jeff KingSep 4, 2021
  4. Fedor BiryukovSep 4, 2021
  5. Fedor BiryukovSep 4, 2021
  6. Fedor BiryukovSep 4, 2021
  7. Jeff KingSep 4, 2021
  8. Fedor BiryukovSep 4, 2021
  9. Jeff KingSep 4, 2021
  10. Elijah NewrenSep 5, 2021
  11. Ævar Arnfjörð BjarmasonSep 5, 2021
  12. Fedor BiryukovSep 5, 2021
  13. Elijah NewrenSep 8, 2021
  14. Junio C HamanoSep 5, 2021
  15. Elijah NewrenSep 8, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.