How to work with Github

GhoulofGSG9GhoulofGSG9 Join Date: 2013-03-31 Member: 184566Members, Super Administrators, Forum Admins, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Reinforced - Supporter, WC 2013 - Supporter, Pistachionauts
edited August 2013 in Modding
I have written this little essay because I think it would be a general improvement if more modder would use github:

Images are in the spoilers

First of all what are the advantages of using github:
  • Be Social
    • Share your code with the rest of the world, so maybe some other devs read it
      and help you to improve it
    • Give people a chance to be a part of the workflow by commenting on changes and posting issues
    • Work as team: By using github all team members work on the same version of the code and can easily share their changes
    • Wiki: Store all needed infos about the project right with the code
    • Follow other Projects to get latest updates
  • Automatically Project-Management:
    • Check the changes you have made easily before committing them, if a change should break something roll back with one click
    • Work with forks and braches: want to try something create a fork /branch with one click and work
      on a project without changing the main source, if your new changes
      improve the project in the way you wanted. Merge them into the master fork or if you
      don’t own the project sent a pull request so maybe also the owner
      likes your changes and merge it.
    • Statistics: Github provides you with all kind of statistics. do you want to see who committed how much at what time? - no problem
    • Issue management: Manage reported issues and feature requests in the way you want and make lists what has to be fixed first
    • Easily search for methods, lines etc at your repo
    • Lost your local files, no problem github has a backup
    • Don’t waste time: Want to work on your project, now you can do it everywhere where you have access to the internet


Ok now let’s go, here is how you use github the easiest way:

First Steps:
  1. Sign up at github.org (You only need a email a username and a password)
  2. Download the github client (either for win or mac, linux has a built in gitshell)
  3. Log into Github with the client


Create your first repo:
A repo is basically where you store your project:
  1. Go to local ->repositories
  2. Click on create
    git1.jpg
  3. Choose a name and a location to store the repo
  4. Click on create
  5. Now you will notice that there is a new repo, open it
    git2.jpg
  6. Some important files (optimal) are already stored inside the repo:
    1. .gitattributes : convert files like e.g .doc to text
    2. .gitignore :all files git will ignore like temp files of compiler or SDK
    3. readme : Basic infos about your project
    4. license: The lincense which is used for your project (e.g. GPU v2)
  7. git3.jpg
    Now add files by clicking on tools -> open in explorer and just copy all codes
    you already have. Best way to go is to create the repo first and
    then use the folder as output at the spark launch pad
  8. Before you can publish/sync you have to commit the (first) changes. Every
    commit needs a little title like : Patch to work with Build 251
  9. Publish/sync to upload your changes to github
  10. Create/manage branches (click at master) : Branches are simple said copies of you
    master branch which allow you to work on the code without changing
    the master branch.


Working with a repo:

Update the github explorer folder to create a changelog and commit changes
to branch: Use merge to pull all changes of a branch into another one
(e.g merge dev into master)

Fork repos from other users (use the website for that) to e.g. write
patches for them.

At the end here is a good example of working with github : Shine

I wish you alot of fun exploring github

Comments

  • BigRustyRedBigRustyRed Join Date: 2012-11-30 Member: 173786Members, Reinforced - Shadow
    Great tutorial for a great website, thank you!
  • GhoulofGSG9GhoulofGSG9 Join Date: 2013-03-31 Member: 184566Members, Super Administrators, Forum Admins, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Reinforced - Supporter, WC 2013 - Supporter, Pistachionauts
    edited August 2013
    Updated the post a bit anything else i should cover? Of course i only did the basics. E.G. you also can keep repos only local. I use that function to get code changes by any ns2 update so i knew if i have to update my mod (if a file or method i use is changed)
  • puzlpuzl The Old Firm Join Date: 2003-02-26 Member: 14029Retired Developer, NS1 Playtester, Forum Moderators, Constellation
    This is an impressive little node tool for working with git in a visual way.


  • GhoulofGSG9GhoulofGSG9 Join Date: 2013-03-31 Member: 184566Members, Super Administrators, Forum Admins, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Reinforced - Supporter, WC 2013 - Supporter, Pistachionauts
    edited August 2013
    puzl wrote: »
    This is an impressive little node tool for working with git in a visual way.

    All shown features are included in the github client, so is there any other advantage than that it is a web app?
Sign In or Register to comment.