Git Task
Git Task
Git is a popular version control system. It was created by Linus Torvalds in 2005. It is
designed to make it easier to have multiple versions of a code base, sometimes across multiple
developers or teams
Functions of Git
Manage projects with Repositories
Clone a project to work on a local copy
Control and track changes with Staging and Committing
Branch and Merge to allow for work on different parts and versions of a project
Pull the latest version of the project to a local copy
Push local updates to the main project
3-Tree Architecture:
The Git workflow is divided into three states:
Working directory - Modify files in your working directory
Staging area (Index) - Stage the files and add snapshots of them to your staging area
Git directory (Repository) - Perform a commit that stores the snapshots permanently to
your Git directory. Checkout any existing version, makes changes, stage them and
commit.
a. Git Installation
b. Creating a GitHub account
c. Git Commands - Working with Local and Remote Git Repositories
Step 2:
• Browse to the official Git website: https://git-scm.com/downloads
• Click the download link for Windows and allow the download to complete
Step 3:
• Double click the git-installer to install git on your system by following the instructions.
Step 4:
• Git is installed and Git Bash is in the interface to Git.
• Step 5: Ensure git is installed. Click on Git Bash to start the command interface.
$ git –version //Which displays the installed version of git
b. Creating a Git Hub Account
• Step 1: Browse the website https://github.com and click on Signup
• Step 2: Enter your email address with which you want to access github and also create a
password for the same.
• Step 3: Complete the verification process by selecting the spiral galaxy in the given set of
images.
• Step 4: Complete the account creation by entering the launch code that is sent to your
email address as a part of confirmation.
b. Working with Git Commands: Local Repository
Introduce yourself to Git:
For the first time when you start with Git you need to enter the username and email address with
which the
GitHub account is linked. This is to access the remote repository from your local repository.
• git config --global user. name “USER NAME"
• git config --global user.email USER@MAILID
Push the local repository contents on the remote repository using command
○ git push
Refresh GitHub to check the uploaded content