Currently, when I run git svn dcommit
git creates a separate commit in SVN for every local commit I've made since last syncing with SVN. Is there any way for dcommit
to instead combine all my recent local commits into one commit for SVN?
相关问题
- Correct procedure to use pending branch changes in
- how to make commitizen override default git commit
- Problem cloning a single SVN Branch via git svn
- How do I completely uninstall git from my Linux Ma
- git merge against an arbitrary base revision (git-
相关文章
- How to set upstream branch in git-svn?
- Error in git: You can only push your own commits i
- Git: How to diff two different files in different
- How Docker calculates the hash of each layer? Is i
- How to modify git repository to add submodules in
- How to change committed User name in bitbucket?
- git-svn “Couldn't find revmap for”
- Does the Pandas DataFrame.to_sql() function requir
should bring you to the menu where you can pick commits or squash them all into 1 commit in order to avoid polluting your svn repository. This is a really good (but short) resource on working with git-svn.
No, but you can squish all the commits together pretty easily. For the following example, I'm going to assume you're on the
master
branch corresponding to the remotetrunk
branch and that you want to squish all local commits together:Instead of using a temporary tag you could also just use the reflog (i.e. use
master@{1}
in place oflocal
)This worked for me--squashed several commits into one commit and then dcommitted to svn:
http://www.gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html
A simpler way could be (if you have multiple commits piled up on your local system):
When I work with git-svn and want a series of git commits to show up as a single commit, I work on a topic branch and then do a non-fast-forward
merge
into master beforedcommit
-ing.First, rebase your branch against svn and make sure local master is up-to-date:
Then switch to master, merge and dcommit:
This will show up as a single commit in Subversion but you will still have your local history that got you to that commit.
that is not working for me. I use
merge --no-ff --no-commit
but after commit, I got:dcommitting to trunkwill commit all 336 commits.
resetting, tagging, and squashing as described in answer #2: Combine local Git commits into one commit for git-svn will work, but on next "merge" you will have some trouble to get all commits together again!
the one and only that is working for me:
to get all commits from master to svn without loosing history for future merging with the same command
~Marcel