Skip to content

Instantly share code, notes, and snippets.

@justinhennessy
Created October 21, 2013 09:43
Show Gist options
  • Save justinhennessy/7081250 to your computer and use it in GitHub Desktop.
Save justinhennessy/7081250 to your computer and use it in GitHub Desktop.
Mycharity git document

Repo

https://github.com/everydayhero/mycharity

Make a local copy of repo

git clone https://github.com/everydayhero/mycharity.git

Create fullname.txt and add "justin hennessy" to it

To see the changes that have been made from the last commit

git diff
diff --git a/justin.txt b/justin.txt
new file mode 100644
index 0000000..3bb29da
--- /dev/null
+++ b/justin.txt
@@ -0,0 +1 @@
+Justin Hennessy

To "stage" a file to be commited

git add justin.txt

You can also stage changes for a whole directory (or all files if you are in the root of your repo)

git add .

If you want to review each change before you add them use

git add -p

To check the diff of staged changes

git diff --cached

To commit changes locally

git commit -v

-v will open up a text editor with the full commit detail in it for review

To see a log of local commit changes

git log
commit 250053aeed6510feb40f0a6f028096c1260bc12f
Author: Justin Hennessy 
Date:   Mon Oct 14 19:35:39 2013 +1000

    Added file with my full name

commit a9619540a30965da4359df61532856087290b9e9
Author: Everyday Hero User 
Date:   Mon Sep 30 02:27:39 2013 -0700

    Initial commit

To pull down and merge changes from origin/master

git pull

To push up changes from your local copy to origin

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