Git Collaboration Basics (2)

Rebase for clean history Interactive rebase Reorder, squash, or rewrite a range of commits: git rebase -i HEAD~5 Common directives: pick: keep the commit reword: edit the message squash: merge into the previous commit edit: pause to adjust content Resolve conflicts and continue git status # fix conflict markers <<<<<<< ======= >>>>>>> git add <resolved-file> git rebase --continue git rebase --abort Coordinate with the team Rewriting shared history requires coordination. Prefer git push --force-with-lease to avoid overwriting teammates’ work. ...

April 14, 2022 Â· 3 min Â· 445 words

Git Collaboration Basics (1)

Configure and inspect Before committing on a new machine, confirm each configuration layer and avoid stale credentials: git config --system --list git config --global --list git config --local --list git config --list --show-origin Set identity and useful aliases: git config --global user.name "Team Member" git config --global user.email "[email protected]" git config --global core.editor "code --wait" git config --global alias.st status Share ignore rules across repositories: git config --global core.excludesfile ~/.gitignore_global echo '.DS_Store' >> ~/.gitignore_global Path from working tree to commit Know how changes move between working tree, index, and repository: ...

April 13, 2022 Â· 3 min Â· 604 words