Hoping this is not a dup, I didn't find any concise information on how to update a git-svn repo. I used git svn clone to import an SVN repo into git. Then, after doing some commits, I wanted to rebase with regards to the original SVN repo.
C:\Work\osqa>git svn rebase
Migrating from a git-svn v1 layout...
Data from a previous version of git-svn exists, but
.git/svn
(required for this version (1.7.3.1.msysgit.0) of git-svn) does not exis
t.
Done migrating from a git-svn v1 layout
forum/views/readers.py: needs update
update-index --refresh: command returned error: 1
When I repeated the git svn rebase command a second time, I got just the tail of the last message:
C:\Work\osqa>git svn rebase
forum/views/readers.py: needs update
update-index --refresh: command returned error: 1
I'm not sure what the error message means. Can you help resolve it?
Use git-svn, it is really simple. First clone your repository with git svn clone then you can git svn dcommit your work or git svn rebase it on the latest changes. Make sure your history is always linear by always rebasing your local branches on master so that you can merge them with git merge --ff-only .
# Clone a repo with standard SVN directory layout (like git clone): git svn clone http://svn.example.com/project --stdlayout --prefix svn/ # Or, if the repo uses a non-standard directory layout: git svn clone http://svn.example.com/project -T tr -b branch -t tag --prefix svn/ # View all branches and tags you have ...
What is Git-SVN? The git-svn tool is an interface between a local Git repository and a remote SVN repository. Git-svn lets developers write code and create commits locally with Git, then push them up to a central SVN repository with svn commit-style behavior.
This probably means that you are receiving a new svn revision which modifies a file which (for some reason) does not exist in your git commit equivalent of the parent svn revision.
If I recall correctly, that means that there are uncommitted changes to that file. What's the output of git status
?
If you are working on a Windows system and the output of git status
returns "no changes added to commit", it may be a problem with the file attributes on FAT file system. Try executing git config core.fileMode false
Also the autocrlf
setting could cause this.
Looks like you have uncommitted file changes.
git status
# if you see pending changes, you can do multiple things
Stash them and pull latest and revisit them.
git stash
git svn rebase
git stash pop
If changes are intended and u like to commit it.
git add <file>
git commit -m '<commit message>'
git svn rebase
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With