Skip to content

Instantly share code, notes, and snippets.

@dunvi
Last active December 13, 2015 18:39
Show Gist options
  • Save dunvi/4957372 to your computer and use it in GitHub Desktop.
Save dunvi/4957372 to your computer and use it in GitHub Desktop.
quickstart guide for greg
FOR GREG ONLY:
To get the whole thing ready for use:
git remote add origin git://github.com/cs121-team394/sudoku.git
git pull origin
CHECK HERE THAT THE FILE ".gitignore" NOW APPEARS IN THE REPOSITORY
git add . (REVIEW THIS STEP)
git commit -m "add a message here"
git push origin
might have to type "git push origin master"
at this point, the sudoku code should be successfully stored on github
To get the code on a new computer:
git clone [email protected]/cs121-team394/sudoku.git
this command should automatically set the alias "origin" for you.
To get updates to the code from github:
git fetch origin
git merge origin/master
To make changes to your code:
git branch <branch name here>
git checkout <branch name here>
short hand for both: "git checkout -b <branch name here>"
<make your changes here>
git add <file names here>
git commit -m "add a message here"
short hand for both: "git commit -a -m "add a message here""
git checkout master
git merge <branch name here>
(git branch -d <branch name here> if you want to delete it afterwards)
Always make your changes in a new branch.
Then what you want to do is pull down changes from the server
before merging in your branch. This helps avoid
conflicts between people working on the same stuff
at the same time (aka it forces you to manage any
conflicts before it touches the server :P)
To push your changes to github for other people:
git push origin master
NOTE: you will have to set an ssh key probably. This part
is a little complicated. Github has a guide, it sorta sucks
but it's a start. If you get a fatal error, the first thing
you should check is type "git remote -v" and make sure
that the address of origin is "[email protected]/blahblahblah"
and not "git://github.com/blahblahblah".
when in doubt, google
if google tells you to rebase, be careful :P
A good resource for "OH SHIT WHAT DO I DO" moments with Git:
http://git-scm.com/book
And this is the resource to use if you want to reeeeally understand what's going on:
http://ftp.newartisans.com/pub/git.from.bottom.up.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment