Git
Last updated
Was this helpful?
Last updated
Was this helpful?
Merging is nice because it’s a non-destructive operation. The existing branches are not changed in any way.
Rebase moves all of the commits in feature on top of main, it changes the commit history of feature to make the history more clean
Make sure the feature is only for your use, since branch’s history has diverged from everybody else’s.
After rebased , force push
is needed in order to rewrite the history
Firstly, it can make a copy of project to your repo through forking
Then, clone the code on local
After that, execute the following commands to update the code from source if needed
To cancel the committed change and reset the head
Discard all the committed changes and staged/ unstaged changes
Put back your committed changes and staged changes into unstaged changes
Only put back your commited changes into unstaged changes
To compare the change of file
To get the commit history of file
To get file change and each commit line by line
To search the file based on keyword
To record all your operations on local, including changing branch
If you want to recover some of operated changes, such as reset change, deleted branch change
You can checkout based on the history
Cherry pick and revert can both select the commit of content from other branch into current branch
But revert is to select the opposite version of the commit
Hooks can reside in either local or server-side repositories, and they are only executed in response to actions in that repository. Here is the list of action:
pre-commit
prepare-commit-msg
commit-msg
post-commit
post-checkout
pre-rebase