Git Commands

Sr.No Title Description Image
1 git push origin --delete To delete a remote branch
2 git push origin master -- force When code is not getting pushed to remote branch after using git push origin master
3 git reflog To bring back recover a deleted commit.
4 git reset HEAD^ --hard Discard changes, back to last commit
5 git reset HEAD^ --soft  Save your changes, back to last commit
6 git checkout feature To switch to the feature branch.
7 .gitignore It will exclude the files or folders listed under it from our machine to be pushed into our repository
8 git reset --hard {commitId} Move head back to the desired commit we want.
9 git reset --hard move head back to the last commit.
10 git fork means we are copying the repository to our remote account(Github/gitlab ...)
11 git clone Means we are making a copy of the repository in our system.