a quick guide to using git on CAEN
by: otto sipe
github: @ottosipe
email: ottosipe@umich.edu
git add .
to add the changes in the current directory or git add filname
git commit -m "your description of changes here"
to make a commitgit push
to send them to the main repogit pull
to pull those changesin ~/.git
folder on CAEN: git init --bare eecs280/proj1
from CAEN home: git clone ~/.git/eecs280/proj1/
or from remote: git clone uniqname@login.engin.umich.edu:~/.git/eecs280/proj1
first push use: git push origin master
ssh uniqname@login.engin.umich.edu
mkdir .git; cd .git
git init --bare eecs280/proj1
eecs280
and a repository called proj1
git clone ~/.git/eecs280/proj1/
git
will most likely warn you that you've cloned an empty repogit --version
will give you a version number if you dogit clone uniqname@login.engin.umich.edu:~/.git/eecs280/proj1
git commit -am "initial commit"
to commit your changesgit push origin master
to send them to the server
origin master
once to let your machine know to create the master
branch on the remote repo.git
) use git pull
to pull the changes you made on your local machine.
pull
and push
on your own even if your on CAEN. when you push to CAEN you're pushing to the hidden remote repo in .git/
not to your regular fileone of the best reasons to use git
is for the ability to create branches of your code and revert to old versions if you make a mistake - more on this later! (or serach "git tutorial" on google)
repo
or repository
: where git
stores your files, really just a folder.git clone
: the process of copying a repo, locally or to a different machinegit add
: add changes to the stage of next commitgit commit
: add changes to your project. each snapshot is a called a commit
git commit -am "[message]"
: shorthand to add all changes and commit with a messagegit pull
: pull changes from a repo (used after you've run clone
)git push
: push changes to a repo