git - the simple guide
gitversion-controlbeginnerworkflow
Abstraction: Minimal beginner reference for core git commands and workflow
Key points:
- Three local trees: Working Directory (actual files), Index (staging area), HEAD (last commit)
- Basic workflow:
git add→git commit -m "msg"→git push origin <branch> - Branching:
git checkout -b feature_xto create and switch;git branch -d feature_xto delete; branch must be pushed to be visible to others - Merge conflicts must be resolved manually then re-staged with
git add; preview diffs first withgit diff <source> <target> - Tag releases:
git tag 1.0.0 <first-10-chars-of-commit-id> - Useful log flags:
--pretty=oneline,--graph --oneline --decorate --all,--name-status,--author=bob
Connections: Git · Version Control · Branching · Merging