Belajar GitHub Dasar 12 Menit Buat Pemula

3 min read 2 hours ago
Published on Sep 30, 2025 This response is partially generated with the help of AI. It may contain inaccuracies.

Table of Contents

Introduction

This tutorial is designed to help beginners understand the basics of GitHub without complicated setups. By the end of this guide, you will have a foundational grasp of using GitHub, which is essential for version control and collaboration in software development.

Step 1: Create a GitHub Account

  • Visit the GitHub website: github.com
  • Click on "Sign up" in the upper right corner.
  • Fill in your details:
    • Username
    • Email address
    • Password
  • Verify your email address by following the link sent to your inbox.

Step 2: Set Up a New Repository

  • After logging in, click on the "+" icon in the top right corner and select "New repository."
  • Fill out the repository details:
    • Repository name (unique identifier)
    • Description (optional but helpful)
    • Choose between public or private visibility.
  • Click "Create repository" to finalize.

Step 3: Install Git on Your Computer

  • Download Git from the official website: git-scm.com.
  • Follow the installation prompts based on your operating system (Windows, macOS, or Linux).
  • After installation, open your terminal (or Git Bash on Windows) and configure Git with your information:
    git config --global user.name "Your Name"
    git config --global user.email "your.email@example.com"
    

Step 4: Clone the Repository Locally

  • Open your terminal and navigate to the directory where you want to store your project.
  • Use the following command to clone your repository:
    git clone https://github.com/yourusername/repositoryname.git
    
  • Replace "yourusername" and "repositoryname" with your actual GitHub username and repository name.

Step 5: Make Changes to Your Project

  • Navigate into your cloned repository:
    cd repositoryname
    
  • Create or modify files as needed using your preferred code editor.

Step 6: Stage Your Changes

  • After making changes, stage the files you want to commit:
    git add .
    
  • The . means you are adding all changes. You can also specify individual files.

Step 7: Commit Your Changes

  • Commit the staged changes with a descriptive message:
    git commit -m "Your commit message here"
    

Step 8: Push Changes to GitHub

  • Push your local commits to the remote repository on GitHub:
    git push origin main
    
  • If your default branch is named something other than "main," use that name instead.

Step 9: Create a Branch (Optional)

  • To work on new features without affecting the main code, create a new branch:
    git checkout -b new-branch-name
    
  • Make changes, stage, commit, and push as needed.

Conclusion

Congratulations! You have learned the basic steps to use GitHub effectively. Key points include creating an account, setting up a repository, and managing changes through Git commands. As a next step, consider exploring more advanced features such as pull requests and collaborating with others on projects. Happy coding!