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

  • SEARCH
  • Home
  • 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

we have a git svn repo that fetches from svn and shows all the
Working SVN repo I'm starting a git repo to interact with a svn repo.
Trying to convert my local SVN repo to Git using svn2git as suggested by
In my git repo which is tracking a svn repo I have made a
I have a fresh git-svn repo (11.13 GB) that has over a 100,000 objects
So I have a local build file. It shouldn't be in SVN at all,
I have a local svn repo on my hard-drive which has directory structure as
If I have checked out a SVN repo and work on it locally all
We have a new git repo that is acrued from a svn repo. The
I have checked out the OpenCV SVN repo, installed all necessary libraries, compiled it

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.