Docs
Let's quickstart

Learn Git and GitHub

In this tutorial, we will cover the basics of Git and GitHub. Follow the steps below to get started.

Step 1: Installing Git

To begin, you'll need to install Git on your computer. Follow the instructions for your specific operating system:

Step 2: Configuring Git

Once Git is installed, you'll need to set up your username and email. Open a terminal and run the following commands:

git config --global user.name "Your Name"
git config --global user.email "you@example.com"

Replace "Your Name" and "you@example.com" with your own name and email address.

Step 3: Creating a Repository

Next, let's create a new Git repository. Navigate to the directory where you want to create the repository and run:

git init

This initializes a new Git repository in the current directory.

Step 4: Making Commits

Now that you have a repository, you can start making commits. Create a new file, add some content, and then commit it to the repository:

touch myfile.txt
echo "Hello, Git!" >> myfile.txt
git add myfile.txt
git commit -m "Added myfile.txt"

Step 5: Creating a GitHub Account

If you haven't already, create an account on GitHub by visiting https://github.com/ (opens in a new tab) and following the sign-up process.

Step 6: Pushing to GitHub

To push your local repository to GitHub, follow these steps:

  1. Create a new repository on GitHub.
  2. Follow the instructions provided by GitHub to add your existing repository to GitHub. This typically involves running a few Git commands.

Step 7: Collaborating on GitHub

You can collaborate with others on GitHub by forking repositories, making changes, and creating pull requests. Explore the GitHub interface to get familiar with these features.

Conclusion

Congratulations! You've learned the basics of Git and GitHub. Keep practicing and exploring more advanced features to become a Git expert!