Jump to content

Transitioning from SVN to GIT


Euphy

Recommended Posts


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

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

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

  • 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:

 

Please, commit your changes or stash them before you can merge.

Aborting

 

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:

 

CONFLICT (content): Merge conflict in src/map/atcommand.c

 

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:

 

<<<<<<<: Indicates the start of the lines that had a merge conflict.

=======: Indicates the break point used for comparison. Breaks up changes that user has committed (above) to changes coming from merge (below) to visually see the differences.

>>>>>>>: Indicates the end of the lines that had a merge conflict.

 

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.
  • Upvote 6
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  737
  • Reputation:   216
  • Joined:  11/29/11
  • Last Seen:  

I don't think you wanted to copy .svn file to I suggest:

rsync -r --exclude .svn trunk/ rathena

that should be way more faster

  • Upvote 1
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:  

why is GIT better than SVN?

what's the difference of the two?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  192
  • Reputation:   9
  • Joined:  05/08/13
  • Last Seen:  

why is GIT better than SVN?

what's the difference of the two?

 

You can check out this link for more info about the transition to GIT. http://rathena.org/board/topic/85124-now-available-on-github/

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  237
  • Reputation:   19
  • Joined:  06/05/13
  • Last Seen:  

still the updates in Git and SVN will be the same? and lastly, we can directly download from Git without updating the old trunk? *(For Newbies)



i hope the SVN will be alive, dont kill it! downloading via git is too hard for me

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:  

Now I'M just switch from SVN to GIT.

And Its working fine for me

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  15
  • Reputation:   3
  • Joined:  09/11/13
  • Last Seen:  

Thank god the switch is finally happening. Was wondering how long the project will be stuck on SVN.

Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  9
  • Reputation:   4
  • Joined:  01/19/12
  • Last Seen:  

Hello,

 

you might read about GIT vs. SVN before you decide to stick to SVN

https://git.wiki.kernel.org/index.php/GitSvnComparison

 

GIT has many advantages over SVN and there's a good reason of why GitHub and GIT are the common choice for developers nowadays

 

In any case, you can also pull the GitHub repository with SVN, just use the following URL

https://github.com/rathena/rathena

and it should pull via SVN nicely.

For more information about that read https://help.github.com/articles/which-remote-url-should-i-use

Edited by DarkDevine
  • Upvote 1
Link to comment
Share on other sites

  • 3 weeks later...

  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  332
  • Reputation:   15
  • Joined:  12/11/11
  • Last Seen:  

Is there anyway to download git updates in rar files like in svn-___- this git stuff is so complicated

 

 
  • 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.

 

 

 

 

When I type this, it asks me to overwrite each file one by one. how do  I exactly type this so it overwrites all files?

Edited by Phenex
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   0
  • Joined:  06/11/13
  • Last Seen:  

Do I need to copy .git folder too? because when I do a clone it has a .git folder and my when I do a SVN checkout it has a .git folder too. What do I have to override?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  7
  • Reputation:   1
  • Joined:  10/13/13
  • Last Seen:  

I'm wondering. Would the learning curve for Git be easier compared to SVN? (Assuming the one to learn was a newbie like me. ^__^)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  332
  • Reputation:   15
  • Joined:  12/11/11
  • Last Seen:  

So far I find it complicated to even get started with git.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.01
  • Content Count:  98
  • Reputation:   4
  • Joined:  10/14/12
  • Last Seen:  

hum about this what is the real order??? copy .git to svn  or svn to .git?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  52
  • Reputation:   6
  • Joined:  01/06/12
  • Last Seen:  

http://git.or.cz/course/svn.html should help if you're familiar with SVN but unfamiliar with GIT. 

Edited by Variant
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  32
  • Topics Per Day:  0.01
  • Content Count:  247
  • Reputation:   207
  • Joined:  10/23/12
  • Last Seen:  

You could actually still stick with SVN, you can just use the GIT repo as the checkout.

 

svn co https://github.com/rathena/rathena/trunk
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.01
  • Content Count:  98
  • Reputation:   4
  • Joined:  10/14/12
  • Last Seen:  

@akinari this is what i do ^^

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  174
  • Reputation:   2
  • Joined:  08/30/13
  • Last Seen:  

You could actually still stick with SVN, you can just use the GIT repo as the checkout.

 

svn co https://github.com/rathena/rathena/trunk

 

So I just need to copy the whole "svn co https://github.com/rathena/rathena/trunk" on SVN checkout?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  125
  • Topics Per Day:  0.03
  • Content Count:  595
  • Reputation:   23
  • Joined:  02/23/12
  • Last Seen:  

after i stash save

 

run these right? then it will still save my old settings right?

 

git pull
git stash pop
 

what happend if i forgot to to stash pop? replaced? 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  5
  • Reputation:   0
  • Joined:  09/23/13
  • Last Seen:  

when i command " git clone https://github.com/rathena/rathena.git "

problem=>  command not found

 

why?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   3
  • Joined:  02/11/12
  • Last Seen:  

when i command " git clone https://github.com/rathena/rathena.git "

problem=>  command not found

 

why?

 

 

install git

If you're using CentOS x = yum -y install git

 

If you're using Debian/Ubuntu = apt-get install git

Edited by Saiku
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  5
  • Reputation:   0
  • Joined:  09/23/13
  • Last Seen:  

when i command " git clone https://github.com/rathena/rathena.git "

problem=>  command not found

 

why?

 

 

install git

If you're using CentOS x = yum -y install git

 

If you're using Debian/Ubuntu = apt-get install git

problem > You need to be root to perform this command.

i try cd server or cd trunk, but same error"You need to be root to perform this command."

 

i'm using centOS

 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  130
  • Topics Per Day:  0.03
  • Content Count:  528
  • Reputation:   18
  • Joined:  09/11/12
  • Last Seen:  

How can i download to a special Rev. with GIT?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   3
  • Joined:  02/11/12
  • Last Seen:  

 

when i command " git clone https://github.com/rathena/rathena.git "

problem=>  command not found

 

why?

 

 

install git

If you're using CentOS x = yum -y install git

 

If you're using Debian/Ubuntu = apt-get install git

problem > You need to be root to perform this command.

i try cd server or cd trunk, but same error"You need to be root to perform this command."

 

i'm using centOS

 

 

..Then login as root or

 

su yum install git

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  332
  • Reputation:   15
  • Joined:  12/11/11
  • Last Seen:  

How can I merge the new updates with my edited files?..

like what is the command? It's not very clear on the guide.

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...