CS174
Chris Pollett
Oct. 6, 2010
git init name_of_git_repository.
git clone path_to_clone_from to_folder #from scratch case git pull path_to_from_repos branch_name_you_want_to_pull_into #existing case git checkout branch #makes branch the current branch in the repository you are working on
git config -l #lists current config settings. git config setting_name new_value #changes a setting
git config --global user.name "Your Name Comes Here" git config --global user.email you@yourdomain.example.com
git add file_or_folder #folders added recursively, #.gitignore can be used to list files you don't want added or managed. git clean #gets rid of files git doesn't know about git rm file #removes the file from the repository, with -f deletes from filesystem git mv loc1 loc2 #moves file from loc1 to loc2 git checkout [rev] file #gets the [rev] version of the file into the current branch #-f overwrites uncommitted changes.
git commit -m "Commit message" git commit -a -m "Commit message" #the -a adds any unmanaged files to the repository
git reset --hard HEAD
git branch
git format-patch rev1 rev2
git apply < file_with_patch
git tag -a tag_name revision -m "message about creating tag"