简体   繁体   中英

How can I do a force commit using git-svn?

I have a dev branch I'm working on and want to commit it. However through an unfortunate series of events which I won't get into, my git svn thinks its already up to date and there is nothing to commit.

Essentially right now I want to clobber the remote contents of my branch with the local version of my branch. Similar to a git push --force , except with git svn. Something like git svn dcommit --force .

I realize there are other ways such as checking out another copy and copy/pasting the repo's contents. But I'm hoping for a simple "forcing" solution like the one that exists with pure git.

"git-svn dcommit" doesn't have --force option or any analogue of it. You may try SmartGit client:

  1. Open your Git-SVN repository with SmartGit
  2. Select Remote->Push advanced. Check "Force" checkbox, press Push.

SmartGit may ask whether to push branch as New branch or to push into Existing branch. If you select New, SmartGit will choose SVN branch name from you Git branch name (eg for refs/heads/XXX it will choose branches/XXX). If you select Existing, SmartGit will look through your current branch history until "git-svn-id:" commit is met and will push your branch to the URL specified there. I think the second option is better for your case.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM