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.

1885 questions
1549
votes
33 answers

How do I migrate an SVN repository with history to a new Git repository?

I read the Git manual, FAQ, Git - SVN crash course, etc. and they all explain this and that, but nowhere can you find a simple instruction like: SVN repository in: svn://myserver/path/to/svn/repos Git repository in:…
Milan Babuškov
  • 55,232
  • 47
  • 119
  • 176
577
votes
13 answers

What's the significance of the "No newline at end of file" log?

When doing a git diff it says "No newline at end of file". What's the significance of the message and what's it trying to tell us?
Pacerier
  • 76,400
  • 86
  • 326
  • 602
544
votes
9 answers

See changes to a specific file using git

I know that I can use the git diff command to check the changes, but, as far as I understood, it is directory based. This means it gives all the changes of all files on the current directory. How can I check only the changes in one specific file?…
Mellon
  • 33,620
  • 73
  • 177
  • 259
390
votes
17 answers

Pushing an existing Git repository to SVN

I've been doing all my work in Git and pushing to GitHub. I've been very happy with both the software and the site, and I have no wish to change my working practices at this point. My PhD adviser is asking all students to keep their work in an SVN…
cflewis
  • 7,000
  • 6
  • 26
  • 36
326
votes
2 answers

How to remove origin from git repository

Basic question: How do I disassociate a git repo from the origin from which it was cloned? git branch -a shows: * master remotes/origin/HEAD -> origin/master and I want to remove all knowledge of origin, and the associated revisions. Longer…
awy
  • 3,995
  • 3
  • 20
  • 25
322
votes
3 answers

How to git-svn clone the last n revisions from a Subversion repository?

Problem How do you create a shallow copy with git-svn from a Subversion repository, e.g. how do you pull only the last three revisions? The git clone command can get the last n revisions from a Git repository if you use the option --depth, i.e. you…
Lernkurve
  • 17,488
  • 24
  • 77
  • 110
196
votes
6 answers

Ignore modified (but not committed) files in git?

Can I tell git to ignore files that are modified (deleted) but should not be committed? The situation is that I have a subdirectory in the repo which contains stuff I'm not interested in at all, so I deleted it to prevent it showing up in…
John Doe
196
votes
9 answers

How do I tell git-svn about a remote branch created after I fetched the repo?

I'm using git-svn to work against my company's central Subversion repository. We've recently created a new feature branch in the central repo. How do I tell Git about it? When I run git branch -r I can only see the branches that existed when I ran…
Hank Gay
  • 65,372
  • 31
  • 148
  • 218
195
votes
3 answers

git-svn: how do I create a new svn branch via git?

I have a git repository which tracks an svn repository. I cloned it using --stdlayout. I created a new local branch via git checkout -b foobar Now I want this branch to end up in …/branches/foobar in the svn repository. How do I go about…
kch
  • 71,135
  • 44
  • 128
  • 148
190
votes
1 answer

Checkout remote branch using git svn

I have checked out a svn repository using git svn. Now I need to checkout one of the branches and track it. Which is the best way to do it?
markovuksanovic
  • 14,436
  • 11
  • 42
  • 56
176
votes
7 answers

How can I remove an SSH key?

I currently have an old SSH key uploaded on a server. The problem is I lost my ~/.ssh directory (with the original id_rsa and id_rsa.pub files). Consequently, I want to remove the old SSH key directly on the server and upload a new one. I tried the…
user1364743
  • 4,293
  • 4
  • 42
  • 82
162
votes
10 answers

Is it possible for git-merge to ignore line-ending differences?

Is it possible for git merge to ignore line-ending differences? Maybe I'm asking the wrong question ... but: I tried uisng config.crlf input but things got a bit messy and out of control, specially when I applied it after the fact. For one thing,…
hasen
  • 148,751
  • 62
  • 182
  • 223
157
votes
6 answers

Is it possible to have a Subversion repository as a Git submodule?

Is there a way to add a Subversion repository as a Git submodule in my Git repository? Something like: git-svn submodule add https://svn.foo.com/svn/proj --stdlayout svn-project Where https://svn.foo.com/svn/proj points to a Subversion…
davitenio
  • 2,291
  • 2
  • 22
  • 13
153
votes
6 answers

git selective revert local changes from a file

In my git repo which is tracking a svn repo I have made a number of edits to a single file. Now I want to revert those changes(like svn revert), but only portions of the file. I want to be able to view the diffs on the file, discard(revert) the…
Pradeep
  • 3,939
  • 4
  • 28
  • 41
135
votes
6 answers

Is git-svn dcommit after merging in git dangerous?

My motivation for trying out git-svn is the effortless merging and branching. Then I noticed that man git-svn(1) says: Running git-merge or git-pull is NOT recommended on a branch you plan to dcommit from. Subversion does not represent merges in…
Knut Eldhuset
  • 1,789
  • 3
  • 16
  • 18
1
2 3
99 100