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
1615
votes
34 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
  • 59,775
  • 49
  • 126
  • 179
710
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
  • 86,231
  • 106
  • 366
  • 634
698
votes
13 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
  • 37,586
  • 78
  • 186
  • 264
440
votes
4 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
  • 5,271
  • 5
  • 23
  • 28
397
votes
18 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,251
  • 7
  • 28
  • 37
330
votes
5 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
  • 20,203
  • 28
  • 86
  • 118
253
votes
9 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
  • 5,283
  • 6
  • 51
  • 90
209
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
202
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
  • 70,339
  • 36
  • 160
  • 222
198
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
  • 77,385
  • 46
  • 136
  • 148
191
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
  • 15,676
  • 13
  • 46
  • 57
176
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
  • 161,647
  • 65
  • 194
  • 231
162
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,361
  • 2
  • 22
  • 14
160
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
  • 4,099
  • 4
  • 31
  • 45
153
votes
5 answers

How can I combine two commits into one commit?

I have a branch 'firstproject' with 2 commits. I want to get rid of these commits and make them appear as a single commit. The command git merge --squash sounds promising, but when I run git merge --squash my terminal just brings up options for the…
Don P
  • 60,113
  • 114
  • 300
  • 432
1
2 3
99 100