Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3343640
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:58:41+00:00 2026-05-18T00:58:41+00:00

My repo is SVN, and I do all development with git. We have a

  • 0

My repo is SVN, and I do all development with git. We have a standard layout, and I initialized my local repo with git svn init -s <url to repo>

Here’s my workflow for working with branches:

# creates a new branch remotely
git svn branch new-branch-name

# switches to a branch or trunk locally
git reset --hard name-of-branch
git reset --hard trunk

# merge changes from trunk into a branch
git reset —hard name-of-branch
git merge trunk
git svn dcommit

That last command above will commit the changes to the branch name-of-branch. My question is, how does git know this? When I do git reset --hard foo, what exactly happens?

This might just come down to a general question about git. Every time I try to research an answer I get confused about if svn integration is a special case or not.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T00:58:41+00:00Added an answer on May 18, 2026 at 12:58 am

    git-svn will look up the commit tree for ancestor commits that correspond to active SVN branches (the refs/remotes/... branches that correspond to branches in SVN). It will then dcommit to those.

    Note that you should not merge and then dcommit — SVN’s and Git’s branching model do not match up, and this kind of thing can fubar your SVN history. You should instead git rebase trunk when you are on the branch. (Alternatively, git svn rebase.)

    Also, be aware that the branch you check out prior to the rebase should be a local branch. If it is not, you can create one with git checkout -b local-branch-to-create remote-branch. Then git rebase trunk.

    If you want to squash all of the commits that were rebased into one, then do this after the rebase: git reset --soft trunk && git commit.

    Once you are happy with the commits that now live on top of trunk, just git svn dcommit to push them to the SVN server.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So i have this local SVN repo that i am using for my dev
So I'm using git and interacting with an svn repo. I have a svn
I have moved an SVN repo to Git and probably due to a number
I have a svn repo on my machine (Windows). Anyone have a script to
I have an SVN repo at a hosted SVN service which I need to
I've got a git-svn clone of an svn repo, and I want to encourage
Seems like a simple problem: I have an SVN repo inside our firewall. I
I have checked out now a local working copy of a codebase that lives
We got all psyched about from from svn to hg and as the development
How do I sync all the code in the SVN repository (for development purposes)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.