Appendix B. A Bit More About Git

For the most part, working with Git as the only programmer on a project is fairly straightforward: you make changes to your code, commit them, push them to GitHub (or another remote repository), and that’s that.

Until…it isn’t. Maybe you updated your README.md file on GitHub and forgot to git pull before making changes to the same file on your device. Maybe you forgot to add a message when you ran git commit. While dealing with these kinds of hiccups is not really all that complicated, some of the error messages and default behaviors of Git in the terminal can be tricky to deal with if you’ve never encountered them before. While the guidance in this appendix is far from comprehensive, in my experience a basic working knowledge of Git is more than enough, unless and until you’re working with a relatively large team in a large organization. So while you should definitely move beyond these simple fixes if you’re planning to use Git with multiple collaborators on complex projects, for most of us, these examples cover the situations you’ll find yourself in—and need help getting out of—most often.

You Run git push/pull and End Up in a Weird Text Editor

Like me, Git is relentless when it comes to documenting your work, to the point that it will not let you commit changes without a commit message. That means that if you run a commit command without including the -m "Commit message here", for example:

git commit filename

you will most likely find your ...

Get Practical Python Data Wrangling and Data Quality now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.