Git is a tool used for source code management. It is a version control system used to handle small to very large projects efficiently.
Git is the most commonly used version control system. Git tracks the changes you make to files, so you have a record of what has been done, and you can revert to specific versions should you ever need to. Git also makes collaboration easier, allowing changes by multiple people to all be merged into one source.
So regardless of whether you write code that only you will see, or work as part of a team, Git will be useful for you.
-
Free and open source
-
Tracks history
-
Scalable
-
Branching
-
Secure
- Modify the file
- Staging
- Commit
- Clone - it allows you to clone the repos available on GitHub.
- Pull - It pushes the changes to remote repos
- Push - It fetch the changes that are done by other user on remote repo.
- Branches - Branch in Git is used to keep your changes until they are ready. You can do your work on a branch while the main branch (master) remains stable. After you are done with your work, you can merge it with the main office.
Goto link - https://brew.sh/
Copy the available link and paste it in terminal and execute
After execution use command “brew install git”
Check if you have successfully installed git or not by using git –version
Goto Link- https://git-scm.com/download/win
When you've successfully started the installer, you should see the Git Setup wizard screen.
Follow the Next and Finish prompts to complete the installation.The default options are pretty sensible for most users.
Open Git Bash, and check if you have successfully installed git or not by using git --version.
git init - To initialize a repository.
git add - to save the project to the staging area
git commit - saves the snapshot of the project the main branch
git checkout - to change the branch
git branch “branch name” - to create new branch
git reset “ID” --hard - to reset to a previous commit
git log - to show all the commits
git remote add origin "LINK" - to add GitHub link.
git push origin master - to push changes to remote directories
git pull - to fetch changes from remote repos.
git status - to check current status of repository
git log - lists all the commits which have been made
.gitignore file is use to add file name which are supposed to be ignored
GitHub is a web-based Git or version control repository on the Internet with a hosting service. It offers the distributed version control and source code management (SCM) functionality of Git as well as adding its own new features.