Questions tagged [git-svn]

git-svn is a bidirectional bridge between git and Subversion allowing to use a remote Subversion repository as a local Git repository while still be able to send changes back to Subversion.

This function allows a developer to work in git locally while still using a SVN repository as the master revision control system. They can use all features of git locally, and then check their files into a Subversion server when they are ready to commit. Running git locally allows the developer to use the staging area, do branching and merging, rebasing, cherry-picking, etc.

Basic Commands:

This makes a local git copy of the SVN repository:

git svn clone url://path/to/repo -s

Work with the files using the local Git repo. When ready to commit changes to git:

git commit -am 'What I worked on'

To commit back to the master SVN server:

git svn dcommit

If working with other developers and a merge is necessary, git-svn rebase pulls any changes from SVN to your local git repository.

1931 questions
66
votes
2 answers

What is a Git commit ID?

How are the Git commit IDs generated to uniquely identify the commits? Example: 521747298a3790fde1710f3aa2d03b55020575aa How does it work? Are they only unique for each project? Or for the Git repositories globally?
Ankur Loriya
  • 3,276
  • 8
  • 31
  • 58
66
votes
12 answers

Unable to determine upstream SVN information from HEAD history

Why do I get this error message?
Chad
  • 2,938
  • 3
  • 27
  • 38
64
votes
4 answers

Delete a svn-Branch via git?

I'am using git as scm of choice but have to use a svn-repo. I can create a svn-remote-branch like this: git svn branch the_branch But how can i delete the remote branch?
DerKlops
  • 1,249
  • 1
  • 12
  • 24
61
votes
4 answers

How do I make git-svn use a particular svn branch as the remote repository?

A word of warning: I'm a n00b to git in general. My team uses feature branches in svn, and I'd like to use git-svn to track my work on a particular feature branch. I've been (roughly) following Andy Delcambre's post to set up my local git repo, but…
Hank Gay
  • 70,339
  • 36
  • 160
  • 222
60
votes
3 answers

How to send pull request on Git

We have recently migrated to Git from SVN. We have setup a bare repository on one machine in our LAN network and cloned on other machines. Now when anyone do the changes and commits we want that he sends the pull request to the bare repo (by telling…
jimy
  • 4,848
  • 3
  • 35
  • 52
59
votes
3 answers

Git-svn: create & push a new branch/tag?

After cloning an SVN repository using git-svn with the -s option (git svn clone http://server/repo -s), how does one create a branch or tag and have pushed to the relevant branch/tag directory in the repository when dcommiting? For instance; if I…
Phillip B Oldham
  • 18,807
  • 20
  • 94
  • 134
57
votes
7 answers

What's the git equivalent of "svn update -r"?

I'm a recent git convert. It's great to be able to use git-svn to keep my branches locally without disturbing the svn server. There was a bug that existed in the latest version of the code. I wanted to establish a time when it worked so that I could…
fratrik
  • 1,700
  • 2
  • 15
  • 17
57
votes
6 answers

Keep git history when splitting a file

I want to take a function out of one file and put it into another, but keep the blame history. cp a.php b.php vim b.php # delete everything but 1 function vim a.php # delete the 1 function git add a.php b.php git commit But if I run git blame…
Paul Tarjan
  • 48,968
  • 59
  • 172
  • 213
56
votes
2 answers

Error with git rebase ("could not apply...")

I'm the administrator of the GitHub repository https://github.com/plison/opendial. I would like to reduce the number of commits on the repository, since the repository already has a few thousand commits, many of whom are minor debugging changes that…
Pierre Lison
  • 678
  • 1
  • 5
  • 7
56
votes
4 answers

How to remove subversion remote in git?

I have a git repository that was originally created using git-svn. Now I have a git server that I push to and the svn repository has been lost. Can I remove the svn remote? How?
jlconlin
  • 14,206
  • 22
  • 72
  • 105
52
votes
3 answers

Retroactively Correct Authors with Git SVN?

I have a repository which I have already cloned from Subversion. I've been doing some work in this repository in its Git form and I would hate to lose that structure by cloning again. However, when I originally cloned the repository, I failed to…
Daniel Spiewak
  • 54,515
  • 14
  • 108
  • 120
52
votes
7 answers

How to clone a specific branch in git bitbucket

I want to clone a specific branch. I don't want download the master branch. How do I clone the whole project and then switch to validations branch?
ruby student
  • 1,059
  • 4
  • 12
  • 18
50
votes
3 answers

Add new commit to the existing Git tag

I have created a Git tag as v1.1 using git tag -a v1.1 -m 'my version 1.1' and I pushed that tag. Later, I made some changes related to v1.1. Now when I push new changes and check the git tag using git describe it is showing me v1.1-g2dcc97. How…
PVH
  • 788
  • 1
  • 7
  • 12
49
votes
4 answers

Add svn repo to existing git repo?

I know you can track a svn repo with git by using git svn init, however that is for if you want to create a brand new repo. My situation is that I currently already have an existing git repo and want to track the trunk of a svn repo by making it a…
rip747
  • 9,375
  • 8
  • 36
  • 47
49
votes
4 answers

warning: refname 'xxx' is ambiguous when using git-svn

I am using git as a frontend to Subversion (via git svn). So, for every svn trunk/branch I have remote branch in git named "remotes/xxx". For example "remotes/trunk", "remotes/coolfeature". Now I want have one "default" local branch for every remote…
Ivan Dubrov
  • 4,778
  • 2
  • 29
  • 41