Learning by reading documentation is very important and even essential as a developer. As a developer, you will have to read a lot of documentation to learn about new technologies coming to the market every day. So it’s good to build a habit of reading documentation. We will learn Git and GitHub by reading documentation.
If you're new to Git and GitHub, don't worry! We'll start from the basics and guide you through. By the end of this onboarding guide, you'll have a solid understanding of how to use Git, GitHub, and their essential features for collaborating on projects.
- Git: A Version Control System (VCS) that helps you track changes in your code. Think of it as a checkpoint system for your code—every time you make a commit, Git saves your code's history, allowing you to access it later.
- GitHub: An online platform that provides a beautiful user interface for Git. It makes collaboration easy by enabling teams to work on projects from anywhere in the world. It is an essential tool for team collaboration.
- Open any browser and search for Git download.
- Download Git for your specific operating system (Windows, macOS, or Linux).
- Install Git on your system.
- During installation, you'll also get Git Bash, a terminal ideal for learning Git commands.
Pro Tip: While you can use other terminals (like VS Code's terminal), some Git commands work best on Git Bash.
- Open github.com and create an account.
After installation, follow these steps to configure Git:
-
Open Git Bash.
-
Run the following commands to set your username and email (used for commit tracking):
git config --global user.name "Your Name" git config --global user.email "[email protected]"
-
To verify the configuration, use:
git config --list
-
Open the GitHub repository you want to copy, click on the "Code" button, and copy the repository link.

-
Create a folder on your computer where you want to clone the repository.
-
Open Git Bash and navigate to the folder you created using the command:
cd <folder-directory>
-
Clone the repository by running:
git clone <repository-link>
-
You have successfully cloned the repository!
There are two ways to open a specific folder or repository:
cd <folder_directory>
or right-click the folder on your computer, select "More options," and choose "Open Git Bash here"

Here are some essential Git commands you'll use frequently:
- Sign Up: Create an account at GitHub.
- Create a Repository:
- Click on "New Repository" and give it a name.
- Choose whether it will be public or private.
- Connect Git to GitHub:
-
Copy the repository's URL.
-
In your terminal, run:
git remote add origin <repository-url> git push -u origin main
-
At ChaiCode, we use a structured branching strategy to manage our projects effectively:
mainbranch: The stable production branch.developmentbranch: The integration branch for ongoing development.- Feature branches: Separate branches for working on specific features or fixes. These branches are merged into
developmentonce complete.
To create and switch to a new branch:
git branch feature/tea-menu
git checkout feature/tea-menuAlternatively, use:
git checkout -b feature/tea-menuTo merge a feature branch into development:
-
Switch to the
developmentbranch:git checkout development
-
Merge the feature branch:
git merge feature/tea-menu
If there are merge conflicts:
-
Open the conflicting files and make the necessary edits.
-
Add the resolved files to the staging area:
git add <file-name>
-
Commit the merge:
git commit
A pull request (PR) is used to propose changes and collaborate on code reviews. Follow these steps to create a PR:
-
Push your branch to GitHub:
git push origin <branch-name>
- Go to the repository on GitHub and click on Pull Requests.
- Click New Pull Request.
- Select the base branch and compare branch.
- Provide a clear and concise description of the changes.
- Include the purpose of the PR and any relevant context.
- Mention related issues or tasks using keywords like
Fixes #issue-number.
- Add reviewers who are familiar with the codebase or the changes.
- Highlight specific areas in the code that require attention.
-
Write Clear Commit Messages: Use descriptive messages that explain what your changes do. Example:
Added user authentication feature -
Commit Frequently: Commit small, logical changes often to keep your project’s history clean.
-
Use Branches: Create branches for new features or bug fixes. Example:
git checkout -b feature/new-feature
-
Collaborate Effectively: Use pull requests to review and discuss code changes with your team.
-
Resolve Conflicts: When working with a team, learn how to resolve merge conflicts effectively.
Use meaningful and consistent branch naming conventions:
feature/<feature-name>: For new features.bugfix/<issue-name>: For fixing bugs.hotfix/<critical-issue>: For urgent fixes.
Welcome aboard, and happy coding! 🚀













