Skip to content

Instantly share code, notes, and snippets.

@whyrusleeping
Created January 23, 2013 16:23
Show Gist options
  • Save whyrusleeping/4609052 to your computer and use it in GitHub Desktop.
Save whyrusleeping/4609052 to your computer and use it in GitHub Desktop.
Notes from the git lesson last night

To copy a git repository from online (github or other)

git clone [insert url here]

That will create a directory for the project and copy it to your local machine.

Once youve made changes to the files, for each file you modified do:

git add myFile.txt

Once you have made enough changes that you want to save them: (Do this often!!!)

git commit -m "i changed this and that"

And finally, if you have the proper permissions to the online repository, you can upload your code with:

git push origin master

In the last statement, origin and master are keywords, origin referring to where you cloned it from, and master referring to the default 'branch' or set of code you are working on.

As an alternative to cloning an existing repository from online, you can make your own by typing the following (ensure the directory you are in is specific to your project)

git init

If you have any further questions, or this guide isnt clear on something please contact me! I am more than willing to share my knowledge of git!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment