Introduction to Git
Git is the distributed version control system. It allows us to have “versions” of a project and tracks the changes made to the code over the time. Also, we can compare two versions and undo the changes if necessary. Git plays a vital role on larger projects in which more than one developers are working on the same project.
For Further exploration, refer: https://git-scm.com/videos
Steps to Install Tortoise
- Go to link https://tortoisegit.org/
- Click Download.
- Choose the download link that suits for your system (either for 32-bit OS or for 64-bit OS)
4.Once the download is completed, follow the below steps to Install tortoise:
- Open Set up Wizard.
- Click Next [Symbol] Next [Symbol]Install.
- Select Yes to install.
- Click Finish.
Steps to Create Account in GitHub
- Go to the link https://github.com/
- Fill in the following fields: Username, Email Address and Password for the GitHub Account.
- Click Sign up for GitHub Button.
- Choose Unlimited public repositories for free as personal plan.
- Click Continue Button.
- Provide the general information, if necessary. Otherwise skip this step.
- Click Submit Button.
To Create a Repository in GitHub
- Click the plus on the top right corner. Choose New Repository.
- Enter the name and Description (Optional) of the repository.
- Select Initialize this repository with a README.
- Click Create Repository Button.
Steps to Create Branch
- Go to the Repository.
- Click the Branch: Master drop down.
- Give name for the Branch and Click Create Branch
To Clone the Git to local System
- Go to the repository. Click Clone or Download Button
- Copy the URL from the drop down.
- Create a New Folder in your System.
- Right Click on the folder. Choose Git Clone.
- In the dialog box, paste the above copied URL in URL field.
- Click OK Button.
Command to clone Repository,
Git clone https://github.com/your-username/repository-name
e.g.: Git clone https://github.com/MetaSoftTechSys/TestProject
To Pull code from GitHub
- Right Click on the folder (That is cloned in the above step)
- Choose TortoiseGit [Symbol] Pull [Symbol] Click Ok.
- To view the difference, Click Pulled Diff.
Command to pull:
To Commit code to GitHub
- Place the code in the folder to which want to commit.
- Right Click on the root folder. Choose “Git Commit [Symbol] …”.
- Provide the Message for Commit.
- Select the files which you want to commit.
- Click Ok Button.
Command to Commit:
Git Commit –all
To Push Code to GitHub
- Right click on the Folder. Choose TortoiseGit [Symbol] Push.
- Select the branch to which you want to push.
- Click Ok Button.