Site icon Puneet Sharma – Freelance Web Developer

Git Commands – For Memory

Git Commands - For Memory

Git Commands - For Memory

Here are some frequently used GIT commands.

Getting & Creating Projects


Basic Snapshotting

Branching & Merging


Sharing & Updating Projects

Inspection & Comparison

Push a branch to master branch or other


Forcefully get the repository version of the branch:

If you have any local changes, they will be lost. With or without –hard option, any local commits that haven’t been pushed will be lost.

Saving current commits in a new local branch before resetting:

You can save current local commits before resetting by creating a local branch with the commits.

Git Stash – saving uncommitted changes:

This saves uncommitted changes and you can reapply them later on.

git stash     // saves uncommitted changes git stash pop // re-apply uncommitted changes     ————– Will be adding more commands ———————–    

Exit mobile version