1 2 3 4 5 6 7 8 9 10
$ git config --global user.name 'John Wilson' // configure a global name to be used with your commits $ git config --global user.email 'email@example.com' // configure a global email address to be used with your commits $ git init // initialize new local git repository $ git clone URL // clone existing git repository in the current directory $ git add <filename> // Add file(s) to staging, * for all files in directory $ git status // list changed and staged files waiting for commit $ git commit -m "commit message" // write a useful and specific comment about the changes $ git merge <branchname> // merge a different branch into active branch $ git push // send changes to master branch with same name $ git pull // fetch and merge changes from master branch
When working alone there are many ways to manage files. However when collaborating with other developers on the same project it is important to be able to merge and resolve conflicts quickly and easily. Git allows a team to work together, track changes, branch off to work on new ideas and suggest changes with pull requests.
Although the command line is not visually rich and can be unintuitive, it is concise and powerful. It requires fewer resources than a graphical interface and common tasks can actually be faster to perform or even saved as scripts.
Programs like Tower include a graphical user interface to manage git repositories.