Akiba
[img]http://i.imgur.com/o3RYT4v.png[/img]
- 4,262
- Posts
- 14
- Years
- Age 25
- in a gap
- Seen Apr 10, 2017
GitHub User Guide and Tutorial
[a id]whatisit[/a id]What is GitHub?
GitHub is an online version control service centered around fast, reliable, safe, and collaboration-centric development. It is used as the fundamental code versioning system for enormous and successful open source projects such as the Linux Kernel, Apache, and Mozilla. However, it is also home to over 2 million other projects, all created and developed by people who want to make the world a better place.
How Does It Work?
GitHub takes your code, files, ROMs, or anything else, and manages a tree of changes, so that any changes can be tracked, reverted, merged, or refactored in an ever-growing variety of ways. GitHub will give you unlimited space for your development (as long as you use it in the intended way). The very nature of unlimited space means that your previous work will never be deleted. With GitHub, you will never lose your progress again! In fact, failure to back up and correctly track and manage project files is the number one reason that an electronic project is halted. Unfortunately, that applies to most hacks started on Pokecommunity.
Sounds Great! How do I start?
For this tutorial, I'll be using my GitHub details. Please use your own details when following the steps.
Username: pokecommunity
Email: [email protected]
Username: pokecommunity
Email: [email protected]
First, let's make an account.
Once that's done, Let's try forking my fork of veekun's Python Pokedex by clicking the 'Fork' button on GitHub.
Now you have a working copy of a Python Pokedex, that belongs to you, and you alone!
Now you have a working copy of a Python Pokedex, that belongs to you, and you alone!
At this point, you'll need to install Git Git is all you'll need to use GitHub, but if you're a Windows or Mac user, you can also download their respective GitHub clients to complement. That said, I'll also be including the command line equivalents of each step for you Linux and CLI users.
$ apt-get install git
$ git config --global user.name "pokecommunity"
$ git config --global user.email "[email protected]"
# or
$ pacman -S git# or
# Installation for other distributions found here
$ git config --global user.name "pokecommunity"
$ git config --global user.email "[email protected]"
Now, it's time to clone the repository on your computer, so that you can work on it. Click on the 'Clone in Desktop' button in GitHub.
$ git clone https://github.com/pokecommunity/pokedex.git
$ git remote add upstream https://github.com/veekun/pokedex.git
# /your_username/repository_name
$ git remote add upstream https://github.com/veekun/pokedex.git
# /parent_author_username/repository_name
Once you have modified the source to your heart's content, you can send your changes back to GitHub, with your GitHub client. Feel free to throw in a summary.
$ git push origin master
You've updated your code, and now it's on GitHub, along with your project's previous states! Everything will always stay there, and you will have a complete history of all of your actions and progresses. You can compare files with a text or binary diff comparison, track development status, and even keep your intended customers up to date. GitHub allows for an unlimited number of people to work on a project at once, as well.
If you would like to commit back to the master repository, GitHub allows for a 'Pull Request'. It's a bright green button that you can't miss. :)
If you would like to commit back to the master repository, GitHub allows for a 'Pull Request'. It's a bright green button that you can't miss. :)
Note: Binaries or anything that can be built from sources should not be versioned. For the special case of ROMs, it is recommended to version patches, which can be automated with a build system.
More coming soon.
Git Reference
# How to create a repository
# Create folder myrepo
$ mkdir myrepo# Enter folder myrepo
$ cd myrepo# Create folder master
$ mkdir master# Enter folder master
$ cd master# Initialize Git repository
$ git init# How to add files
# Add all files
$ git add *# Add individual files
$ git add myfile.ext# How to commit changes
# Commit and stage all changes with a message
$ git commit -a -m "Updated looping function, refactored program stucture"# How to branch and merge
# Copy current state into new branch mybranch
$ git branch mybranch# Change current branch to mybranch
$ git checkout mybranch# After changes confirmed and ready to move back to master
# Change current branch to master branch
$ git checkout master# Merge mybranch into master
$ git merge mybranch# How to push changes
# Push all changes to branch master on origin repository
$ git push origin masterGood? Now go make some amazing hacks and hacking tools!
Last edited: