Notes of Atlassian Git Tutorial
Although we have powerful tools such as sourcetree,
learning the details of git is still very necessary.
I found a fantastic tutorial:https://www.atlassian.com/git/tutorials, this is my learning notes.
git log vs git status
git log: showing all the comments in this branch
git status: showing the overview of this branch
Show commits in graph
draw a graph of all comments:
- Using “git diff” to compare two commits.
- “git add
…”to update what will be committed(stage changes)
”to remove the specified file from the staging area, but leave the working directory unchanged.)
- “git revert
” to generate a new commit that undoes all of the changes introduced in , then apply it to the current branch.
“Whereas reverting is designed to safely undo a public commit, git reset is designed to undo local changes.”
git reset --hard and
git clean -f commands are your best friends after you’ve made some embarrassing developments in your local repository and want to burn the evidence.”
1 2 3 4 5 6 7 8 9
git commit —amend:
1 2 3 4 5 6 7
Difference of git fetch and git pull
git pull =
git fetch followed by a
git merge(remote branch).
Still a little confused.
‘fetch’ is updating the remote branch info, then local branch merge to remote branch !!
git set defaul remote to push
Edit your .git/config
1 2 3
Automatic merge failed; fix conflicts and then commit the result.
Try: git mergetool