Skip to content

git use

skgoetz edited this page Jul 22, 2014 · 2 revisions

Previous: getting started | 2014-07-22, @skgoetz

git is a distributed repository: there is no center, formally. Thus, with any copy of the repository one may check out one or more files from the repository, commit local edits, merge changes when two repos have different versions of a file, push a set of committed edits to github, and pull edited files that have been pushed from another repo and are not yet up to date in one's local repo. Editing files without committing them is fine, even advisable if you mean to fix and test a bug without bothering others.

(If a merge seems odd or you didn't plan to merge something, talk to the other person(s) who have edited the file you're working on.)

Useful syntax in Git Bash:

  • git add file1 file2 file3

  • git commit -m "descriptive comment" file1 file2

These two may be combined via the Git Commit Tool in Windows: right-click anywhere in a git-controlled subdirectory, and msysgit will show all files modified since the last commit, whether or not they're in that directory. Ensure that the commit comment accounts for all of the modified files.

  • git status

  • git push

Git Commit Tool's push doesn't work, at least for me. Use Git Bash instead.

  • git pull

Clone this wiki locally