3

According to the git-svn manual about git svn rebase:

If you have local changes, you must either stash your work or temporarily commit it before running git svn rebase — otherwise, the command will stop if it sees that the rebase will result in a merge conflict

However every time I git rebase, I always get the needs update error message with any locally modified file, even if it would not conflict with incoming changes:

> git svn rebase
path/to/file.txt: needs update

I'm using git-svn version 2.15.0.windows.1 (svn 1.9.7). Is the manual out of date, or am I missing something?

trethaller
  • 587
  • 3
  • 16

2 Answers2

1

Currently, unfortunately it is not possible. From the documentation of git svn 2.38.1:
Like git rebase; this requires that the working tree be clean and have no uncommitted changes. So, you have to stash and pop before using git svn rebase.

But I think there is a problem with this command, because the documentation says: This accepts all options that git svn fetch and git rebase accept, normally git rebase accepts --autostash option.

> git rebase -h
   .
   .
   --autostash           automatically stash/stash pop before and after
   .

but git svn rebase does not accept autostash option.

Sahin
  • 1,032
  • 14
  • 23
0

I have seen that even for a simple git pull

Check your git config core.autocrlf, and make sure it is set to false: that way, you won't have any automatic eol (end of line) modification on checkout (which is the first operation of a rebase)

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • It still won't work. I rebased with `git svn rebase` and after that I changed a file locally. even though there is no other change in svn repository, I am unable to run `git svn rebase` > `git config core.autocrlf` true > `git config core.autocrlf false` > `git svn rebase` testfile.txt: needs update update-index --refresh: command returned error: 1 # I reverted the local changes here > `git svn rebase` Current branch master is up to date. – Sahin Oct 12 '22 at 09:21
  • @Sahin Try the same `git svn init` (full new clone/import) *after* `git config --global core.autocrlf false` – VonC Oct 12 '22 at 10:50