In the 1st part of the most important and commonly used git commands we have talked about git setup, initialization, staging and snapshot, branching and branching. To read the full post click here.
Inspect & Compare
Examining logs, diffs and object information
show the commits on branch A that are not on Branch B
git log branchB . . branchA
show the diff of what is in branch A that is not in branch B
git diff branchB . . . branchA
Tracking Path Changes
Versioning file removes and path changes
change an existing file path and stage the move
git mv [existing path] [new path]
Ignoring Patterns
Preventing unintentional staging or commiting of files
system wide ignore pattern for all local repositories
Share & Update
Retrieving updates from another repository and updating local repos
fetch down all the branches from that GIT remote
git fetch [alias]
transmit local branch commits to the remote repository branch
git push [alias] [branch]
Rewrite History
Rewriting branches, updating commits and clearing history
clear staging area, rewrite working tree from specified commit
Temporary Commits
Temporarily store modified, tracked files in order to change branches
list stack-order of stashed file changes
git stash list
discard the changes from top to stash stack
git stash drop
That's it for the most important and commonly used git commands. To see the Most Important & Commonly Used GIT Commands: Part 1, click here.
0 Comments