Git and GitHub
Installation and Introduction guide
Prepared by
P. Raja, Master Trainer
Edunet Foundation
This guide includes the steps to install Git, Visual Studio Code, and the basic
commands to push files or updates from the local repository to the GitHub
repository, as well as to pull files or updates from the GitHub repository to the local
repository.
1. To install the Git:
i. Go to the Git official website: https://git-scm.com/downloads
ii. Select OS on which you want to install
iii. Click on click here to download
iv. After downloading, Run the installer and follow the default settings.
v. After installation, open the command prompt and type git --version to verify the
installation.
2. To create an account in GitHub
Step 1: Visit GitHub
Open your web browser.
Go to the GitHub website.
Step 2: Sign Up
Click on the "Sign up" button, usually located in the top-right corner of the homepage.
Step 3: Enter Your Details
Email Address:
Enter your email address in the provided field.
Click "Continue".
Create a Password:
Enter a strong password.
Click "Continue".
Choose a Username:
Choose a unique username. This will be your identity on GitHub.
Click "Continue".
Verification:
You may be asked to complete a puzzle to verify you are not a robot.
Follow the instructions and click "Verify".
Step 4: Choose Plan
GitHub offers a free plan and paid plans with additional features.
Choose the "Free" plan unless you need the additional features.
Click "Continue".
Step 5: Personalization (Optional)
GitHub may ask you a few questions to personalize your experience (e.g., about your
coding experience).
You can skip these steps if you prefer.
Step 6: Confirm Email Address
Check your email inbox for a confirmation email from GitHub.
Open the email and click on the "Verify email address" button.
Step 7: Explore GitHub
After verification, you’ll be redirected to your GitHub dashboard.
You can now start creating repositories, collaborating with others, and exploring projects.
3. VC, Branching, Merging & Pull Request.
Step 1: Configure Git
Before using Git, you need to set up your identity:
Step 2: Clone the GitHub repository into local repository through visual studio code IDE
git clone https://github.com/Rajasuku/tnsdcgithub.git
Step 3: Create a new file through visual studio code, as soon as you create a file the status
shows that U, it means untracked.
Step 4: git status, you can use git status to get the status of the files
git status
Step 5: git add, in order to trace the changes that do in the file.
git add test2.txt
git add .
Step 6: commit the changes
git commit -m "commit message"
git commit -m "tets2 file added"
Step 7: Push the change we do in the visual studio code to GitHub repository
git push origin main
Insert → add → commit → push
Step 8: If you modify existing files, it will show them as 'M'.
This assumes "M" is a status indicator in Git or another tool, showing that a file has been
modified.
Step 9: In order to update the changes, need to follow the steps 5,6, and 7.
Step 10: If needed we can delete the file from visual code and the changes can be pushed to
GitHub repository by following steps 5, 6, and 7.
Step 11: Now, create a file in the GitHub repository and fetch the update in Visual Studio
Code.
Git pull
Step 12: Create a folder in local repository and create a file. Next change the directory using
cd command.
Git hidden folder not visible in local directory, because it is not a GitHub repository. We have
to change directory into GitHub directory.
Git init
We have to add and commit the changes.
Step 13: Add remote repository
Now type git branch