Published on 2019-08-01· Updated on 2023-09-04
The author voluntarily contributed this tutorial as a part of Pepipost Write to Contribute program.
Today most of the developers manage their projects using Git, a distributed version control system that supports collaboration. The objective of this Git Cheat Sheet Guide is to provide you a quick reference to commands which you can bookmark and use while working and collaborating in any Git repository.
Create empty repo. Details
git clone <repo>
Clone existing repo. Details
git add <filename>
Stage all changes. Details
git commit -m "<message>"
Commit changes with a message. Details
List staged/unchanged/untracked. Details
Display commit history. Details
Show unstaged changes. Details
List branches. Details
git branch <branch>
Create a new branch. Details
git branch -D <branch>
Delete a branch. Details
git checkout <branch>
Checkout existing branch.Details
git merge <branch>
Merge a branch into the current branch. Details
Save modified + staged changes.Details
git reset <file>
Remove the file from staging.Details
git revert <commit>
Create a new commit, reverting a previous commit's changes.Details
git rebase <branch>
Combine the last commit + staged changes.Details
git reset --hard <commit>
Clear stagging area, rewrite working tree. Details
git remote add <alias> <url>
Add git URL as an alias.Details
git fetch <alias>
Fetch all remote branches.Details
git merge <alias>/<branch>
Merge remote into the current branch.Details
git push <alias> <branch>
Push local commits to a remote repo.Details
Fetch + merge remote commits.Details
Remove files from the working tree and from the index.Details
git remote set-url
Changes URLs for the remote. Sets first URL for remote that matches regex (first URL if no is given) to . If doesn’t match any URL, an error occurs and nothing is changed. Details
We request you to bookmark this Page as more Such Commands and Descriptions are coming your Way.
Thank you for Reading and Happy Coding!
Netcorecloud's toolkit is the solution to all your email problems.
Netcore connects & unifies your data across all sources, connects to your marketing channels and provides you with control over AI Powered automation and personalization.