lprsd
lprsd

Reputation: 87205

How to remove a file from a git commit to push to svn

I replaced a folder and all its contents with a symlink. That is removed the folder and added a symlink, in a single git commit.

Git commit happened normally. However when I try to push to the upstream svn, it complains that the file exists.

Now, how do I amend my commit to not contain the git add of the new symlink and make it a new commit, so SVN can understand to remove and replace the folder; or can I use the svn commit force via git amend.

This is the error I get:

RA layer file already exists: File '/svn/uswaretech_zobpress/site_media/frontend' already exists at /usr/lib/git-core/git-svn line 508

Upvotes: 2

Views: 974

Answers (1)

Alan Haggai Alavi
Alan Haggai Alavi

Reputation: 74272

To remove the file from the HEAD commit:

git rebase -i HEAD~
git rm /path/to/symlink
git rebase --continue

Upvotes: 2

Related Questions