|
| 1 | +title: Git |
| 2 | +category: page |
| 3 | +slug: git |
| 4 | +sortorder: 0222 |
| 5 | +toc: False |
| 6 | +sidebartitle: Git |
| 7 | +meta: Git is an implementation of the source (version) control concept. Learn more about Git and source control on Full Stack Python. |
| 8 | + |
| 9 | + |
| 10 | +# Git |
| 11 | +[Git](https://git-scm.com/) is a distributed open source |
| 12 | +[source control](/source-control.html) (also referred to as "version |
| 13 | +control") system commonly used to track and manage file changes. Git is |
| 14 | +frequently used as the version control system for Python projects. |
| 15 | + |
| 16 | +<a href="https://git-scm.com/" style="border: none;"><img src="/img/logos/git.png" width="100%" alt="Official Git logo." class="technical-diagram"></a> |
| 17 | + |
| 18 | +<div class="well see-also">Git is an implementation of the <a href="/source-control.html">source control</a> concept. Learn how these pieces fit together in the <a href="/development-environments.html">development environments</a> chapter or view the <a href="/table-of-contents.html">table of contents</a> for all topics.</div> |
| 19 | + |
| 20 | + |
| 21 | +## Git tutorials |
| 22 | +Git can take awhile to wrap your head around, even for experienced software |
| 23 | +developers. The following tutorials can quickly get you up to speed. |
| 24 | + |
| 25 | +* The [official Pro Git](https://git-scm.com/book/en/v2) book is available |
| 26 | + online for free. It is awesome both as a step-by-step walkthrough and as |
| 27 | + a bookmarked reference on specific topics. |
| 28 | + |
| 29 | +* [Git from the inside out](https://codewords.recurse.com/issues/two/git-from-the-inside-out) |
| 30 | + provides a spectacular walkthrough for developers who have used Git before |
| 31 | + but want to go deeper in understanding what each command does under the |
| 32 | + covers instead of simply using the tool as a black box. |
| 33 | + |
| 34 | +* [Think like a Git](http://think-like-a-git.net/) is another introduction |
| 35 | + that focuses more on the graph theory and conceptual ideas behind Git |
| 36 | + to help the reader understand what's happening as they use Git commands. |
| 37 | + |
| 38 | +* [Git and GitHub in plain English](https://red-badger.com/blog/2016/11/29/gitgithub-in-plain-english) |
| 39 | + is a high-level overview of both Git and GitHub. This guide is intended |
| 40 | + for both non-programmers and junior developers who want to learn everything |
| 41 | + from terminology to workflow. |
| 42 | + |
| 43 | +* [A Hacker's Guide to Git](http://wildlyinaccurate.com/a-hackers-guide-to-git) |
| 44 | + is a free ebook written for experienced developers that contains both |
| 45 | + the syntax and the conceptual ideas behind how Git works. |
| 46 | + |
| 47 | +* [A Designer's Guide to Git](https://blog.marvelapp.com/designers-guide-git/) |
| 48 | + gives a beginner's Git overview for non-programmers. The tutorial also |
| 49 | + covers using Git clients such as the GitHub desktop application. |
| 50 | + |
| 51 | +* [Git in Six Hundred Words](http://maryrosecook.com/blog/post/git-in-six-hundred-words) |
| 52 | + is a concise essay explaining what happens when you add and commit files |
| 53 | + in a Git repository. |
| 54 | + |
| 55 | +* A |
| 56 | + [practical git introduction](http://marc.helbling.fr/2014/09/practical-git-introduction) |
| 57 | + is rich with pragmatic examples for Git usage. |
| 58 | + |
| 59 | + |
| 60 | +## Specific Git resources |
| 61 | +Large tutorials are great for getting started with Git. However, sometimes |
| 62 | +you need tactical support or want to learn new tricks to add to your |
| 63 | +workflow. These resources will come in handy for specific Git subjects. |
| 64 | + |
| 65 | +* [How to Write a Git Commit Message](http://chris.beams.io/posts/git-commit/) |
| 66 | + provides strong advice that will help you write consistent, concise and |
| 67 | + contextual messages on your commits. Commit messages are especially |
| 68 | + important when working with others on a long-lasting project where you |
| 69 | + dive through the commit history via `git log` and related commands. |
| 70 | + |
| 71 | +* [Oh shit, Git!](http://ohshitgit.com/) is a profanity-filled description |
| 72 | + of tips to get you out of binds you may find yourself in when you get too |
| 73 | + tricky with Git commands. |
| 74 | + |
| 75 | +* [Phil Nash](https://philna.sh/) shows how to use the `git reflog` command |
| 76 | + in [Git back to the future](https://philna.sh/blog/2017/01/04/git-back-to-the-future/). |
| 77 | + |
| 78 | + * [Another Git catastrophe cleaned up](http://blog.plover.com/prog/git-tastrophe.html) |
| 79 | + goes through a difficult merge scenario that required deep Git |
| 80 | + understanding to properly fix. |
| 81 | + |
| 82 | +* Erlang's source code provides a concise explanation on |
| 83 | + [writing good commit messages](https://github.com/erlang/otp/wiki/Writing-good-commit-messages) |
| 84 | + that any programming ecosystem can learn from. |
| 85 | + |
| 86 | +* [GitTips](https://git.wiki.kernel.org/index.php/GitTips) is a list of |
| 87 | + pro tips to clean up common issues and how to dive through Git history |
| 88 | + to find specific text. |
| 89 | + |
| 90 | +* [19 Tips For Everyday Git Use](http://www.alexkras.com/19-git-tips-for-everyday-use/) |
| 91 | + is a laundry list of helpful Git tips on commands such as `git bisect`, |
| 92 | + `git stash` and `git difftool`. |
| 93 | + |
| 94 | +* Git allows command aliasing, which allowed one developer to create his |
| 95 | + own list of [lesser known Git commands](https://hackernoon.com/lesser-known-git-commands-151a1918a60) |
| 96 | + that alias more complicated Git lines. |
| 97 | + |
| 98 | +* [Little things I like to do with Git](https://csswizardry.com/2017/05/little-things-i-like-to-do-with-git/) |
| 99 | + has some nice tips such as easily viewing branches you recently worked |
| 100 | + on and generating a changelog from your commits. |
| 101 | + |
| 102 | +* [Git from the inside out](https://codewords.recurse.com/issues/two/git-from-the-inside-out) |
| 103 | + demonstrates how Git's graph-based data structure produces certain behavior |
| 104 | + through example Git commands. This is a highly recommended read after you've |
| 105 | + grasped the basics and are looking to go deeper with Git. |
| 106 | + |
| 107 | +* [How To Host Your Own Private Git Repositories](https://eklitzke.org/how-to-how-your-own-private-git-repositories) |
| 108 | + provides the steps for handling private Git repositories on your own |
| 109 | + server. This setup is great for either mirroring GitHub repositories |
| 110 | + or just getting away from hosted services entirely. |
| 111 | + |
| 112 | +* [How I configure my git in a new computer](https://medium.com/@Tiagojdferreira/how-i-set-up-my-git-in-a-new-computer-85bb461b089f) |
| 113 | + shows how to handle a `.gitconfig` file, with |
| 114 | + [an example Gist](https://gist.github.com/Tiagojdferreira/115ecac229e176e48d520c59b022e4fb) |
| 115 | + that the author uses for his own environment. |
| 116 | + |
| 117 | +* [How to Quickly and Correctly Generate a Git Log in HTML](http://www.oilshell.org/blog/2017/09/19.html) |
| 118 | + is an interesting look at how string processing on \*nix systems works |
| 119 | + by generating an HTML page from a Git log. If you need to output your |
| 120 | + Git commits somewhere and are having trouble writing your own script |
| 121 | + you should check out some of the interesting solutions the author |
| 122 | + presents. |
| 123 | + |
| 124 | + |
| 125 | +## Git Workflows |
| 126 | +Teams of developers can use Git in varying workflows because of Git's |
| 127 | +distributed model and lightweight branching. There is no "right way" to |
| 128 | +use Git, especially because development teams can range in size from a |
| 129 | +single developer up to entire companies with thousands of developers in |
| 130 | +a repository. The only correct answer is to let the developers decide on |
| 131 | +a workflow that maximizes their ability to frequently commit code and |
| 132 | +minimize merge conflicts. |
| 133 | + |
| 134 | +* [git-flow](http://nvie.com/posts/a-successful-git-branching-model/) shows |
| 135 | + one possible way for small teams to use Git branches. |
| 136 | + [GitHub Flow](http://scottchacon.com/2011/08/31/github-flow.html) explains |
| 137 | + why at GitHub they do not use the git-flow model and provides an |
| 138 | + alternative that solves some of the issues they found with git-flow. |
| 139 | + |
| 140 | +* [Git Workflows That Work](http://blog.endpoint.com/2014/05/git-workflows-that-work.html) |
| 141 | + is a helpful post with diagrams to show how teams can create a Git workflow |
| 142 | + that will help their development process. |
| 143 | + |
| 144 | +* "[Our Git Workflow](http://www.braintreepaymentsolutions.com/devblog/our-git-workflow)" |
| 145 | + by Braintree goes over how this payments company uses Git for development |
| 146 | + and merging source code. |
| 147 | + |
0 commit comments