git commands

Most useful git commands.
intro
Here i summarises the all git commands which is used frequently. It helps developers manage and track changes in their projects.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Tagging
ex: git tag
to check all the tags
ex: git tag -a v1.0 -m “message” to add a tag
ex: git push origin v1.0 push the tag separately
ex: git show tag_name
Branching
ex: git checkout -b feature1 ex: git switch -c feature2 to create a new branch
ex: git branch ex: git branch –all to check how many branch are available
ex: git log
ex: git switch main to switch to the main brach
ex: git switch - to switch to the prev branch
ex: git branch -d branch_name to delete the branch
ex: git push origin feature1 to push feature1 branch to github
ex: git merge feature1 merge feature1 to main branch
ex: git pull origin main first pull -> merge -> then push
ex: git log –graph
ex: git rebase branch_name
ex: git checkout commit_id go back to prev commit
ex: git stash want to save the code without committing
ex: git stash list show all the stash list
ex: git stash apply to apply the stash
Sm0king B!ts