Skip to content

1. How to Contribute

Stella edited this page Feb 17, 2016 · 2 revisions

Guide to git for FJF n00bs

Lesson 1: Clone the repo

  1. In Terminal, navigate to the working directory of your choice
  2. Enter the following command: git clone https://github.com/FeedJonathanFoundation/ubisoft-game-lab
  3. Navigate into the newly created repository: cd ubisoft-game-lab
  4. Replace your_branch with a more informative name and create a new branch: git checkout -b <your_branch>

Lesson 2: Add your changes

  1. Code!!!
  2. Once you're ready to merge your changes, run the following commands:
  • git add filename
    • Change filename to whatever files you changed and want to merge
    • Please add a test scene, if applicable!
  • git commit -m "commit message"
    • Change commit message to a short description of what you changed in this commit
  • git push -u origin <your_branch>
    • Change your_branch to whatever you named your branch
  1. Create a new pull request on GitHub :)
  • Navigate to the main repo
  • Select under "Your recently pushed branches" the option to Compare & pull request
  • Write a detailed description and create
  • Assign appropriate tags under Labels, set the Milestone to the relevant sprint, and tester as Assignee

Lesson 3: Update your_branch with master branch

In order to update files on your branch with most up-to-date files:

  1. Switch to master locally git checkout master
  2. Pull changes git pull
  3. Switch back to your_branch git checkout <your_branch>
  4. Merge master into your branch git merge master
  5. Enter merge message and all that jazz

Lesson 4: Checkout a remote branch for testing

  1. Run git branch -r to see all remote branches
  2. Run git checkout <remote_branch>, replacing remote_branch with the branch of your choice
  3. Create a new branch to commit changes you create git checkout -b <new-branch-name>
  4. Test
  5. If it passes testing, the pull request for that branch can be merged. Or:
  • Write a comment on the pull request with your suggestions
  • Submit a new pull request with your changes

Clone this wiki locally