Git is an open source , distributed version control to handle the projects . Git makes easier everything related the projects like changes to file , what change has been made etc. It is most popular collaborative system that modern IT companies uses . It provides the features of branches and merges .
In this article we will be seeing various Git commands that are used.
- git init - Creates a new git
- git clone - To clone a repository
- git status - It shows the state of current repository
- git log - It lists the commit history
- git diff - difference between the working directory and index.
- git show - It displays the content and metadata
- git branch - It lists all the branches in the repository
- git checkout [branch] - It switches to a branch
- git branch -d : It deletes a branch
- git branch -m : It renames the branch
- git merge [branch] : It merges the specified branch
- git add [file] : Stage changes
- git add : It stages everything
- git revert [file] : It does undo the changes
- git clean -n : It shows the untracked files
- git commit --amend : It replaces the last commit
- git remote add : It establishes a connection to a remote reopsitory
- git pull : It fetches a repository
- git push : It pushes the branch
- git config --global user.name : It defines the author name which is to be used
- git reset : It resets the staging area to match most recent commit .
- git fetch <remote> <branch> : It fetches the a specific from the remote repository.