?. ???/?????????
Default way: git add.
git commit -m “message”
Different: git commit -a -m “message”
?. ???????
Using aliases, you can write your own Git commands to do whatever you want.
Example: git config –global alias.ac ‘!git add -A && git commit -m’
(aliased to ac, git add -A && git commit -m does a full add and commit)
?. ??????
We can easily undo any commit on the current branch using the revert command.
Example: git revert 486bdb2
Another way: git revert HEAD (for the most recent commit)
?. ??????
This command allows you to easily view the latest commits, pull, reset, push, etc. on your local machine.
Example: Git Relogin
?. ??????????
Gives you the option to print out a nice log of your commits/branches.
Example: git log –graph –decorate –oneline
?. ??????????
Gives you the option to print out a nice log of your commits/branches.
Example: git log –graph –decorate –oneline
?. ?????????????
You can also use the log command to search for specific changes in your code.
Example: git log -S “commits in JavaScript are very similar”
?. ?????
This command saves (stores them locally) all code changes, but doesn’t actually commit them.
Example: git storage
?. ?????? ???? ????????
This command deletes all tracking information on the local computer for branches that are not in the remote repository but does not delete local branches.
Example: git remote update –prune
?. ??????
Find out which commits caused a particular bug
Example: git bisect start
git half broken
git bisect 48c86d6
??. ???????????????????
It is possible to refresh all changes in the local branch to the exact contents in the remote branch.
Example: git reset –hard origin/main