Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 02-17-2013, 03:28 PM
demonstar55
Demi-God
 
Join Date: Apr 2008
Location: MA
Posts: 1,165
Default Some git stuff

Hopefully someone can adapt this to a wiki post, but this should help those get started that might be confused, this will be more of a dump of how to do things :P

Cloning the repo (same as svn checkout)

Code:
$ git clone git://github.com/EQEmu/Server.git
If you don't want the folder to be called Server you can do if you would like it to be called EQEmuServer instead

Code:
$ git clone git://github.com/EQEmu/Server.git EQEmuServer
Update repo (svn update)

Code:
$ git pull
Or more fully (it defaults to the origin remote)

Code:
$ git pull origin
Switching to a branch (example TestBranch)

Code:
$ git checkout TestBranch
The rest of the examples assume you have a GitHub account set up with an SSH key generated (https://help.github.com/articles/generating-ssh-keys), although I think you can use HTTPS URLs instead of GIT URLs if you don't want to use ssh keys.

Forking a repo

On https://github.com/EQEmu/Server click the Fork button as seen in this image: http://i.imgur.com/dOZ5sP4.png

Clone your repo

Code:
$ git clone git@github.com:username/Server.git
Keeping your fork in sync with upstream. After you clone your repo you will see your remote (where you can pull/push from) is only yours, you will need to add another remote that is the upstream repo.

Code:
$ git remote -v
    origin  git@github.com:username/Server.git (fetch)
    origin  git@github.com:username/Server.git (push)
Adding the repo

Code:
$ git remote add upstream git://github.com/EQEmu/Server.git
Code:
$ git remote -v                                            
    origin  git@github.com:username/Server.git (fetch)
    origin  git@github.com:username/Server.git (push)
    upstream    git://github.com/EQEmu/Server.git (fetch)
    upstream    git://github.com/EQEmu/Server.git (push)
(Note: You shouldn't be able to push to the upstream repo)

Update from the upstream remote

Code:
$ git pull upstream
This will pull into a special branch or something, so next we need to merge it

Code:
$ git merge upstream/master
And push it to our fork

Code:
$ git push origin
A nice thing about git is that we can now use Pull Requests instead of posting diffs in the Code Submission forum which means hopefully these things can get merged with the main repo much quicker, since copying the diffs can be a pain and most of the devs don't like to bother with them. It's probably best to create a branch in your fork for each pull request you make, then probably delete the branch after it was merged.

Submitting a pull request

On https://github.com/EQEmu/Server click the pull request button shown here: http://i.imgur.com/3jo905K.png

Then select the appropriate branch that has the changes you wish to be pulled into the main repo http://i.imgur.com/QJPAON5.png

Hopefully this provides enough information for people to get going and contributing more! The GitHub help page is wonderful as well, so use that if you are having trouble.

Git for Windows works well enough on Windows, you can do most of these tasks from the GIT GUI in that (http://msysgit.github.com/)

On Linux just follow your distros instructions for installing GIT

OSX: I have no idea!
Reply With Quote
  #2  
Old 02-18-2013, 12:30 PM
Weldarr
Sarnak
 
Join Date: Oct 2005
Posts: 45
Default

Some Additional Pointers after spending a little bit of time trying to figure out the Git stuff:


Windows:
1) Download Git Client: http://code.google.com/p/msysgit/dow...r+official+git
a. The only thing you may want to change in the installation is the context menu. I set mine to not install a context menu because I intended to use TortoiseGit instead (Steps below)

2) Download TortoiseGit: http://code.google.com/p/tortoisegit/wiki/Download
a. Nothing fancy to do here, just simply go through the installation steps.
3) Accessing EQEmu Source:
a. Make a new folder wherever you want the source to be save to.
b. Right click on that folder and you should now have TortioseGit options.
c. Select Git Clone...



d. Type in the EQEmu Source Github address (seen in the picture)



e. Click Ok and it will pull the source.
3) How to update to latest revision (How to Pull):
a. Right click on Server Folder and go to Git Sync.
b. On the far left side of screen you will see a button that says Pull with a drop down menu. Click on the Pull button and it will update your code to the latest version.


4) How to Commit changes (How to Push):
a. You need to have access granted as a developer to commit changes.
b. Right click on the Server Folder and go to Git Sync.
c. In the middle of the screen you will see a button that says Push with a drop down menu. Click on the Push button and it will push your changes to the source.
**Note** I'm not 100% sure on the Push/Pull commands. It seems to be how they work, but I've never used Git before so this is all kind of new to me and I haven't had a chance to test it out yet.

Hope it helps alleviate some confusion that anyone may be having with the migration to GitHub.

- Vaion
Reply With Quote
  #3  
Old 02-19-2013, 02:34 AM
demonstar55
Demi-God
 
Join Date: Apr 2008
Location: MA
Posts: 1,165
Default

Some more cool git commands

Git Stash: Git stash allows you to stash any changes you have made to the working set so you can get back to a clean state. From here you could pull from the main repo to get up to date and then pull your stash back in

Code:
$ git stash
$ git stash list # view a list of whats on the stash
$ git stash apply # reapply the most recent stash
And another cool thing you can do is create a branch from the stash

Code:
$ git stash branch MyBranch
To push the branch to the remote repo

Code:
$ git push origin MyBranch
And to delete the remote branch

Code:
$ git push origin :MyBranch
$ git branch -d MyBranch # delete the branch locally as well
Reply With Quote
  #4  
Old 02-21-2013, 11:18 PM
Disorder
Hill Giant
 
Join Date: Apr 2010
Location: USA
Posts: 133
Default

where do you use these commands? Via cmd?
__________________
Disorder
Reply With Quote
  #5  
Old 02-21-2013, 11:31 PM
demonstar55
Demi-God
 
Join Date: Apr 2008
Location: MA
Posts: 1,165
Default

On Windows, in git bash if you have Git for Windows installed. Or on UNIX's just in the command line. Most of them have equivalent in Git GUI though.
Reply With Quote
  #6  
Old 02-22-2013, 12:39 AM
Disorder
Hill Giant
 
Join Date: Apr 2010
Location: USA
Posts: 133
Default

I see now, thank you. Do we use git to keep quests updated, etc? Also, How do we keep it from overwriting changed quests? Thanks.
__________________
Disorder
Reply With Quote
  #7  
Old 02-22-2013, 12:50 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

quests are still on svn

there is also a tortoisegit, which is somewhat like tortoisesvn

as for keeping your custom stuff from getting overwritten... you can tell both svn and git to ignore certain quests if you want. or you can keep your production quest directory separate from your download directory. that will allow you to check the files that have changed and apply them to your quest directory if you so choose.
__________________
I muck about @ The Forge.
say(rand 99>49?'try '.('0x'.join '',map{unpack 'H*',chr rand 256}1..2):'incoherent nonsense')while our $Noport=1;
Reply With Quote
  #8  
Old 02-22-2013, 12:54 AM
Disorder
Hill Giant
 
Join Date: Apr 2010
Location: USA
Posts: 133
Default

As always, thanks, c0ncrete.
__________________
Disorder
Reply With Quote
  #9  
Old 01-04-2014, 09:45 PM
Randymarsh9
Dragon
 
Join Date: Dec 2007
Posts: 658
Default

I have a question about stashing things. If I want to update my source code, but I have made changes to a file that gets updated in the pull, it tells me to stash my changes first. If I were to stash my changes and the update the source, would it mess stuff up if I pulled in my old files? I'm not exactly sure how git works really, so I don't know if that's good practice. Will it merge them together or will it just overwrite the new files?
Reply With Quote
  #10  
Old 01-04-2014, 10:10 PM
demonstar55
Demi-God
 
Join Date: Apr 2008
Location: MA
Posts: 1,165
Default

If you stash things, update, then pop them from the stash. I believe it just merges the changes, which if there are no merge conflicts, should be painless.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 07:00 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3