Tuesday 26 April 2022

GIT Commands

 1)git config --get remote.origin.url : To know remote github branch url.

2)git rebase and squash : These are used to club multiple commits into one to make PR clean.

3)git stash : to save uncommitted change.

4)git stash apply : to restore changes which were stashed.

5)git switch branch-1 : to switch branch

6)git commit -m "Commit message"

7)git push origin branchName : push changes to branch

8)git diff filename fileName

9)git status:

10)git restore filename

11)git remote -v: will give remote details 

12)git reset --soft HEAD^:  To uncommit your changes in local branch in case you commit something by mistake.

13) git switch master : To switch to any branch

14)git branch -a : list all branches

15)git checkout branchname