Solved

git - cloned svn, did some work with svn, now want to update

Posted on 2011-09-14
10
527 Views
Last Modified: 2012-05-12
Hi Experts,

I cloned my svn repo using "git svn clone http://Myrepo localdir"

I then ignored git, used svn for about 40 more commits.  Git now points to an older revision that svn was using (from when it cloned).

Now I want to pull the rest of the changes from svn into my cloned git repo, how do I do it?

Thanks!
Mike
0
Comment
Question by:thready
  • 6
  • 4
10 Comments
 
LVL 1

Author Comment

by:thready
ID: 36538575
I found it - I used "git svn fetch" - that did it.  However, now that I try to rebase with "git svn rebase", I get errors saying lots of files "needs update", but these files have all been checked in to svn and should have been pulled with the "git svn fetch" that I did.... What am I not understanding properly here?

Thanks!
Mike
0
 
LVL 40

Expert Comment

by:evilrix
ID: 36538604
>> Now I want to pull the rest of the changes from svn into my cloned git repo, how do I do it?
Meh, just delete the git repo and re-clone it ;)
0
 
LVL 1

Author Comment

by:thready
ID: 36538610
it takes a half day.......
0
 
LVL 40

Expert Comment

by:evilrix
ID: 36538629
Wow! It must be a huge repository!

>> and should have been pulled with the "git svn fetch"
fetch only pull changes, it doesn't merge them. Try "git merge FETCH_HEAD"
0
 
LVL 1

Author Comment

by:thready
ID: 36538653
fatal: 'FETCH_HEAD' does not point to a commit
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 40

Expert Comment

by:evilrix
ID: 36538675
Hmmm. To tell the truth, I don't really know then. Other than clone my own svn repos I've always worked 100% with git so at this point I'm about as clued up as you =/

The only other thing I can think of would be to do a hard reset to get your git repo back to a clean start and then try a git svn rebase to rebase the svn changes into the git repo. Not sure if that will work any better. If it doesn't you are probably better off swollowing the pain of just re-cloning and then uninstalling your svn client so you won't be tempted to use it any more :)
0
 
LVL 1

Accepted Solution

by:
thready earned 0 total points
ID: 36539355
I got it!  I added all these "changes" that weren't supposed to be there with "git add -A" - then I committed them.  I was then able to do a "git svn rebase" (which I have to read up on again because I forget what that does exactly)...
0
 
LVL 1

Author Closing Comment

by:thready
ID: 36558809
This worked for me....
0
 
LVL 1

Author Comment

by:thready
ID: 36539361
Note that I would have given you the points just because you are very often helpful, but then moderators have come back on me when I don't accept the real solution!  Thanks again evilrix!  I love git already!  :o)

Mike
0
 
LVL 40

Expert Comment

by:evilrix
ID: 36539476
No worries Mike. Glad you figured it out :)
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

A short article about a problem I had getting the GPS LocationListener working.
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now