Difference between revisions of "Using Github"

From Mochimo Wiki
Jump to: navigation, search
(Created page with "Create a github account and verify email address.<BR> <BR> Login to github and navigate to:<BR> https://github.com/mochimodev/mochimo/ <BR> Click the fork button in the righ...")
 
Line 1: Line 1:
 +
This page describes how to use github to perform basic forking, modification of the software and pull requests.  What follows is the bare minimum of functionality to make a change to the Mochimo codebase and push it back to the github for review and inclusion in the mainline code.
 +
==Getting Started==
 +
'''Step 1:'''
 
Create a github account and verify email address.<BR>
 
Create a github account and verify email address.<BR>
 
<BR>
 
<BR>
 +
'''Step 2:'''
 
Login to github and navigate to:<BR>
 
Login to github and navigate to:<BR>
 
   https://github.com/mochimodev/mochimo/
 
   https://github.com/mochimodev/mochimo/
<BR>
+
'''Step 3:'''
Click the fork button in the right hand corner of the screen.<BR>
+
Click the fork button in the right hand corner of the screen to make a full copy of mochimo under your account.<BR><BR>
Install git on your Linux system:<BR>
+
===Install git on Your Local Machine===
<code>
+
<code>sudo apt-get update</code><BR>
    sudo apt-get update
+
<code>sudo apt-get install git</code>
    sudo apt-get install git
+
<BR><BR>
</code><BR>
+
===Clone Your Fork to Your Local Machine===
Clone your fork to your local machine:<BR>
 
 
<code>git clone https://github.com/YOURUSERNAME/mochimo</code><BR>
 
<code>git clone https://github.com/YOURUSERNAME/mochimo</code><BR>
 
<BR>
 
<BR>
Line 18: Line 21:
 
Confirm with: <code>git remote -v</code><BR>
 
Confirm with: <code>git remote -v</code><BR>
 
<BR>
 
<BR>
Now, sync to the master branch:<BR>
+
===Sync to the Master Branch===
<code>
+
<code>git fetch upstream</code><BR>
    git fetch upstream
+
<code>git checkout master</code><BR>
    git checkout master
+
<code>git merge upstream/master</code><BR>
    git merge upstream/master
+
 
</code><BR>
+
==Making and Pushing Code Changes==
Now make a change to a file on your local system.<BR>
+
===Changing and Verifying a File===
 +
Make any change to a file on your local system.<BR>
 
<BR>
 
<BR>
 
Check to see that you have uncommitted changes:<BR>
 
Check to see that you have uncommitted changes:<BR>
Line 33: Line 37:
 
<BR>
 
<BR>
 
Now commit the change to the local master branch:<BR>
 
Now commit the change to the local master branch:<BR>
<code>git commit</code>
+
<code>git commit</code><BR>
 
<BR>
 
<BR>
 
Enter a comment at the top of the text file and save/exit.<BR>
 
Enter a comment at the top of the text file and save/exit.<BR>
<BR>
+
===Pushing a Change Back to Master===
 
Now push the changes up to your github online master branch:<BR>
 
Now push the changes up to your github online master branch:<BR>
 
<code>git push origin master</code>
 
<code>git push origin master</code>
 
<BR>
 
<BR>
Now submit a pull request from the online portal, by navigating to your repository and clicking on:<BR>
+
===Submitting a Pull Request===
 +
If you want your changes merged to the master branch of the main line code, submit a pull request from the online portal, by navigating to your repository and clicking on:<BR>
 
"New pull request"<BR>
 
"New pull request"<BR>
 
<BR>
 
<BR>
Review your changes, and then click "Create pull request", and you're done!
+
Review your changes, and then click "Create pull request", and you're done! A member of the Core Contributor team will review and/or approve the merge of your changes.  If approved, a bounty will be assigned to you on the Discord "Open-Bounties" channel.

Revision as of 15:35, 9 January 2019

This page describes how to use github to perform basic forking, modification of the software and pull requests. What follows is the bare minimum of functionality to make a change to the Mochimo codebase and push it back to the github for review and inclusion in the mainline code.

Getting Started

Step 1: Create a github account and verify email address.

Step 2: Login to github and navigate to:

 https://github.com/mochimodev/mochimo/

Step 3: Click the fork button in the right hand corner of the screen to make a full copy of mochimo under your account.

Install git on Your Local Machine

sudo apt-get update
sudo apt-get install git

Clone Your Fork to Your Local Machine

git clone https://github.com/YOURUSERNAME/mochimo

Link your local clone to the source repository:
git remote add upstream https://github.com/mochimodev/mochimo.git

Confirm with: git remote -v

Sync to the Master Branch

git fetch upstream
git checkout master
git merge upstream/master

Making and Pushing Code Changes

Changing and Verifying a File

Make any change to a file on your local system.

Check to see that you have uncommitted changes:
git status

Now go to the directory with the changed file and add those changes to a new commit:
git add .

Now commit the change to the local master branch:
git commit

Enter a comment at the top of the text file and save/exit.

Pushing a Change Back to Master

Now push the changes up to your github online master branch:
git push origin master

Submitting a Pull Request

If you want your changes merged to the master branch of the main line code, submit a pull request from the online portal, by navigating to your repository and clicking on:
"New pull request"

Review your changes, and then click "Create pull request", and you're done! A member of the Core Contributor team will review and/or approve the merge of your changes. If approved, a bounty will be assigned to you on the Discord "Open-Bounties" channel.