threads / discuss / 20194

git-svn wowes

Subject: git-svn wowes

## tl;dr

3 messages between Jul 22, 2009 and Jul 23, 2009.

replies: 2people: 3as markdown or json

Aaron Gray· Jul 22, 2009, 13:55 UTC · lore
Hi,
I have a working git-svn clone of a svn based project.
At the mement I have a .sh script run every hour which goes :-
    git svn fetch
    git reset -- hard HEAD
    git svn rebase
I am sure this is like using a hammer to crack a nut.
Is there a better way to do this ?
Many thanks in advance,
Aaron
Sverre Rabbelier· Jul 22, 2009, 18:24 UTC · re: Aaron Gray · lore

Re: git-svn wowes

Heya,

On Wed, Jul 22, 2009 at 13:55, Aaron Gray<aaronngray.lists@googlemail.com> wrote:

>   git svn rebase

Should be enough ('git svn rebase' runs 'git svn fetch' first), assuming you don't touch the working directory, which you probably don't considering that your script blasts away all changes every hour.

-- 
Cheers,

Sverre Rabbelier
Eric Wong· Jul 23, 2009, 08:12 UTC · re: Aaron Gray · lore

Re: git-svn wowes

Aaron Gray <aaronngray.lists@googlemail.com> wrote:
Show 13 quoted lines
> Hi,
>
> I have a working git-svn clone of a svn based project.
>
> At the mement I have a .sh script run every hour which goes :-
>
>    git svn fetch
>    git reset -- hard HEAD
>    git svn rebase
>
> I am sure this is like using a hammer to crack a nut.
>
> Is there a better way to do this ?
Assuming you don't make your own local changes ever:
  git svn fetch
  git reset --hard $ref

Where $ref is most likely "trunk" if you used -s/--stdlayout or "git-svn" if you did not. Running `git branch -r' will give you a list of remote refs that you can reset to.

-- 
Eric Wong

← back to recent threads