Jump to content

Transitioning from SVN to GIT


Euphy

Recommended Posts


  • Group:  Members
  • Topic Count:  29
  • Topics Per Day:  0.01
  • Content Count:  84
  • Reputation:   0
  • Joined:  12/24/13
  • Last Seen:  

 

 

 

Can I update my trunk up to latest using this even though my revision is 17454? Thanks

I only have 2-3 SRC mod. But most of the changes are in my db files.

It seems that you are using the old SVN base. You can checkout the new git base via https://github.com/rathena/rathena/trunk (subversion). Just right click your sources folder, TortoiseSVN->Relocate. If your change are in the db/import folder, they will be keep intact. For the source mod, I cannot tell if they works with the newer version or not.

 

Uhm sorry, I'm quite confused. 

So I'll create a new folder and check-out using this: https://github.com/rathena/rathena/trunk

Then what about this part: " Just right click your sources folder, TortoiseSVN->Relocate. If your change are in the db/import folder, they will be keep intact. "

Sources folder, meaning my old Trunk? What do I need to put on the link on the Relocate box?

 

Thanks.

 

Yes, I mean your old trunk. Right click this folder, point to TortoiseSVN->Relocate and put that github link on the Relocate box. I supposed you use TortoiseSVN, for other client please read their documents. Or you can create a new folder and checkout, then copy your change to that folder.

 

Ohh okay, btw, the link is not working. It says page cannot be found.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  53
  • Topics Per Day:  0.01
  • Content Count:  240
  • Reputation:   40
  • Joined:  04/27/13
  • Last Seen:  

Can I update my trunk up to latest using this even though my revision is 17454? Thanks

I only have 2-3 SRC mod. But most of the changes are in my db files.

It seems that you are using the old SVN base. You can checkout the new git base via https://github.com/rathena/rathena/trunk (subversion). Just right click your sources folder, TortoiseSVN->Relocate. If your change are in the db/import folder, they will be keep intact. For the source mod, I cannot tell if they works with the newer version or not.
Uhm sorry, I'm quite confused. 

So I'll create a new folder and check-out using this: https://github.com/rathena/rathena/trunk

Then what about this part: " Just right click your sources folder, TortoiseSVN->Relocate. If your change are in the db/import folder, they will be keep intact. "

Sources folder, meaning my old Trunk? What do I need to put on the link on the Relocate box?

 

Thanks.

Yes, I mean your old trunk. Right click this folder, point to TortoiseSVN->Relocate and put that github link on the Relocate box. I supposed you use TortoiseSVN, for other client please read their documents. Or you can create a new folder and checkout, then copy your change to that folder.
Ohh okay, btw, the link is not working. It says page cannot be found.

Try https://github.com/rathena/rathena/

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  29
  • Topics Per Day:  0.01
  • Content Count:  84
  • Reputation:   0
  • Joined:  12/24/13
  • Last Seen:  

15oic01.png

This shows up right after I relocate. :o

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  18
  • Reputation:   0
  • Joined:  02/12/14
  • Last Seen:  

This shows up right after I relocate. :o

Maybe you should create a new directory and checkout.

Link to comment
Share on other sites

  • 3 months later...

  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

Before edit your files to new copy

 

If u are using rA old SVN, and stuck in 17704, it's equiv with 4534bd4, soe before do copy-paste (Windows 6th step or Linux 3rd step) from your old SVN files, better make local branch for 4534bd4 first then checkout to that hash. by using

git branch --no-track 17704 4534bd4
git checkout 4534bd4

Then copy-paste everything that u have.

After that, clean up from a mess that maybe u got, then try compile your server. If it's good, save the diff file.

 

Then, how to get up-to-date?

Well, since we're at 17704 (4534bd4) after that checkout, your edits/files are left at that rev. So, let's pray and do

git stash
git checkout master
git stash pop

After that, you will get bad and good news. Good news, you're now in latest rAthena github's revision, and the bad news, maybe you get a ton of conflicts. :P

 

And, these my bonuses, I tried using SmartGIt for simple touches.

  1. Click Branch menu, choose Checkout post-5421-0-20463200-1406659087_thumb.png
  2. Put the hash 4534bd4 on the filter
  3. Click checkout, and it offers you to make new local branch, just make it, 17704. OK post-5421-0-65785900-1406659090_thumb.png
  4. After that, copy paste all your files there.
  5. If everything are OK, don't forget make the diff (SmartGit doesn't have "make diff file" feature yet).
  6. Right-click the master branch, hit checkoutpost-5421-0-58044500-1406659094_thumb.png
  7. Wait, and praying. post-5421-0-12579400-1406659098_thumb.png
Link to comment
Share on other sites

  • 3 years later...

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  16
  • Reputation:   0
  • Joined:  07/17/17
  • Last Seen:  

On 9/3/2013 at 0:27 PM, Euphy said:

Transitioning from SVN to GIT

While switching your server to GIT may sound like a daunting task, it's relatively simple and straightforward, even for servers with heavy modifications. We strongly encourage you to do so, since our primary efforts will now be directed towards our repository on GitHub. Simply follow the steps listed below, depending on your OS:

Windows Instructions

  Hide contents

For this process, we'll be using msysgit and TortoiseGit. Download and install both (in that order) if you don't have them already.

  • In TortoiseGit, right-click and select "Git Clone..." where you want to create your new repository.

    ULa1u8a.jpg

     

  • Enter rAthena's GitHub URL and hit "OK":
    
    
    https://github.com/rathena/rathena
    czNpAgf.jpg

     

  • Cloning may take a minute or two. Hit "Close" after it finishes.

    dgF5HRl.jpg

     

  • Update your SVN repository using TortoiseSVN's "SVN Update".

    9HNDSej.jpg

     

  • Hit "OK" after it finishes. Resolve any conflicts now (read more below).

    5ww9HK7.jpg

     

  • Copy all files in your SVN directory, excluding the .svn folder itself.

    gNTwT7B.jpg

     

  • In your new GIT directory, paste the files you just copied.

    QDXu3Rq.jpg

     

  • When prompted, opt to merge all folders and replace all files.

    N9psegA.jpg

    iOeYCNr.jpg

     

  • In TortoiseGit, right-click and select "Stash Save" to store all your changes.

    tVyxmsw.jpg

     

  • Create a name that you'll recognize later, like "Update to Latest".

    0YPzXbf.jpg


That's it, you're finished. When you want to update your GIT repository, follow these steps:

  • Right-click and select "Pull..." to merge all new changes.

    JSjpp8l.jpg

    Fna1kfs.jpg

     

  • Right-click and select "Stash Pop" to restore your custom changes.

    GwvsyxR.jpg

    sg3BF4Z.jpg

Linux Instructions

  Reveal hidden contents

 

  • Clone the GIT repository:
    
    
    git clone https://github.com/rathena/rathena.git
    This creates the new directory named "rathena" and will be the new server location, but can be changed is desired.

     

  • Update SVN Repo to latest:
    
    
    svn co http://svn.code.sf.net/p/rathena/svn/trunk/
    You can solve conflicts later, but it's best to do it now and make sure you can compile, and even test the server, before continuing.

     

  • Copy the files over:
    
    
    cp -rf trunk/* rathena/
    Recursive tag to copy all sub-directories and files, forced so you don't have to manually accept overwriting each file.

     

  • Configure and compile new GIT server location:
    
    
    ./configure && make clean sql
    If there are any specific functions you enable when configuring, modify this command.

     

  • Shut down old server and start-up new one.

    If you have any server auto-restart scripts, you can either edit the cronjob to point to a new location, or rename directories:

    
    
    mv trunk trunk-bak && mv rathena trunk
  • You can now pull GIT changes by typing:
    
    
    git pull

Notes about GIT:

*These commands assume you have changed directory to new GIT directory.

 

When doing a pull, you may receive a message saying:

 

 

In order to pull changes into your local repository, you have a couple options.  The one which will be most used by our users is going to be to stash the changes and recall these changes after a pull.  If you're just starting using GIT, then you'll need to configure a name and email before doing a stash.

 



git config --global user.email "[email protected]"
git config --global user.name "Your Name"

 

Now, stash local changes:

 

 



git stash save "Update to Latest"

"Update to Latest" can be anything, it's just a note.

 

Do the pull - Followed by a 'pop' to replace your code:

 



git pull
git stash pop

 

No conflicts?  You're good to complete your update!  Otherwise, keep reading...

 

Conflicts

It's possible that you'll run into conflicts along the way, with messages such as:

 

 

When you see these messages, a conflict in merging your code occurred.  Much like resolving code conflicts in SVN, these conflicts create points within the files which show your code compared to the code pulled from the remote repo.  To fix them, open your files and find the conflict locations denoted by:

 

 

Then you can choose which piece of code you wish to keep.  After all shown conflicts are corrected, you can continue your normal update process.

 

References

Credits to @Akinari for writing a good part of this guide.

My client is installed on a cloud instance do i need to follow those steps on my NoVNC? sorry if my terminology is wrong im new to this...

 

Thanks in advanced

Link to comment
Share on other sites

  • 1 year later...

  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  1096
  • Reputation:   344
  • Joined:  02/26/12
  • Last Seen:  

5 years of this wrong guide posted here, and no one corrects the OP about issues, that it will never work properly.
Sorry, but this guide absolutely incorrect at all!

1. https://git-scm.com/docs/git-svn

there is a tool called git svn, the tool specially designed for moving from old not popular anymore and very ineffective SVN to git.
All that needs to do is:

2. Git SVNCLONE <URL>

git svn clone https://github.com/rathena/rathena/blob/master/

or

git svn clone http://<your_svn_repository_link>

It will convert almost ALL commits from SVN since r1 up to the latest revision and will save it in a good format to GIT with saving ALL changes made since the beginning of SVN, with commits, with authors, with changes, etc, without any merge issues whatever. All that is required: is working svn server. The process will take a while (because there is already ~17k commits) each commit need to convert (the git svn tool will do it by itself).

  • Upvote 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...