Skip to content
 
 

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Git and Github Tutorial (Credit to Radwan Albahrani!)

This tutorial was originally made by Radwan Albahrani. I've copied it and removed the segments on branching and beyond to keep it simple. This abridged tutorial only covers what you need to know to submit tasks for the GDG Game Development Bootcamp.

Overview

This tutorial will guide you through the process of setting up your development environment and contributing to a project on GitHub.

Learning Objectives

  • Understand the basics of Git and GitHub.
  • Learn how to clone a repository.
  • Learn how to add changes to a repository.
  • Learn how to commit changes to a repository.
  • Learn how to push changes to a repository.
  • Learn how to create a pull request.

Resources

Setup and Installation

1. Setup

1.1. Install Git (Windows Users Only)

1.2. Install VS Code

1.3 Fork the repository

  • Fork the repository by clicking the fork button on the top right corner of the repository page.

    • Click the fork Button

    Image of forking the repository

    • Name the repo and click "Create fork" Alt text

    • You should now have a copy of the repository on your own account. Alt text

Tutorial

2.1. Git and GitHub

This section will guide you through the process of cloning a repository, adding changes, committing changes, pushing changes, and creating a pull request.

2.1.0. Configure Git

  • Open the terminal and run the following commands to configure Git:
git config --global user.name "<your-name>"
git config --global user.email "<your-email>"

These commands will set your name and email for Git. This information will be used to identify you as the author of the changes you make.

Example:

git config --global user.name "John Doe"
git config --global user.email "JohnDoe@gmail.com"
2.1.1. Clone the repository
  • Open the terminal and navigate to the directory (also known as folder) where you want to clone the repository.
    • Make sure the path you choose has NO ARABIC LETTERS. This will cause errors.
      • On Mac: Alt text
      • On Windows: Alt text
  • Go to the repository page on your own account and click on the green code button.
  • Copy the link under the clone section. Image of github
  • Run the following command inside of the opened terminal to clone the repository:
git clone <The Link from your Repository>

Example:

git clone https://github.com/YOUR_NAME/Selection-Project.git

Alt text

2.1.2. Add changes
  • Open the repository directory in VS Code.

    • The path must be INSIDE the cloned repository.
    • Click on File -> Open folder Alt text
    • Select the repository folder. Alt text
    • The repository should be opened in VS Code. Alt text
    • To make sure, run the following command in the terminal INSIDE Vscode:
    git status
    • The output should be similar to the following: Alt text
  • Run the following command to add the changes:

git add .
2.1.3. Commit changes
  • Run the following command to commit the changes:
git commit -m "<commit-message>"
2.1.4. Push changes
  • Run the following command to push the changes:
git push

Alt text

2.1.5. Create a pull request
  • Go to the repository page and click on the pull request button. Alt text
  • Click on the new pull request button. Alt text
  • Select the branch you want to merge into the main branch. Alt text
  • Click on the create pull request button. Alt text
  • Add a title and description for the pull request. Title should be in the following format: <your-name> - <project-name>. Alt text
  • Click on the create pull request button. Alt text

Conclusion

This tutorial has covered the basics of Git and GitHub enough for you to start submitting your tasks. You should now be able to clone a repository, add changes, commit changes, push changes, and create a pull request.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors