Welcome to the Git and GitHub Tutorial

This tutorial will guide you through the basics of Git and GitHub.

1. Initialize a Git Repository

git init

Initialize a new Git repository in your project directory.

2. Add Changes to the Staging Area

git add filename

Add changes in the specified file to the staging area for the next commit.

3. Commit Changes

git commit -m "Your commit message"

Commit the changes in the staging area with a descriptive message.

4. Push Changes to GitHub

git push origin branch-name

Push your committed changes to the GitHub repository.

5. Switch to a Different Branch

git checkout branch-name

Switch to the specified branch.

6. Create and Switch to a New Branch

git checkout -b new-branch-name

Create a new branch and switch to it.

7. Pull Changes from GitHub

git pull origin branch-name

Pull the latest changes from the remote repository to your local repository.

8. Merge Changes from Another Branch

git merge source-branch

Merge changes from the source branch into the current branch.