Skip to content

Instantly share code, notes, and snippets.

@alexo
Forked from matthewmccullough/notes.markdown
Created January 10, 2012 20:19
Show Gist options
  • Save alexo/1590957 to your computer and use it in GitHub Desktop.
Save alexo/1590957 to your computer and use it in GitHub Desktop.
January GitHub Git Foundations Class Notes

January GitHub Git Foundations Class Notes

How did you do that init again?

git init project2
cd project2
git status
mate index.html
git status

Our code

<body>
   <p>First paragraph</p>
   <p>First paragraph</p>

   <p>Second paragraph</p>
   <p>Second paragraph</p>

   <p>Thirda paragraph</p>
   <p>Thirdb paragraph</p>
</body>

Configuring the editor

git config --global core.editor "theprogramhere"

The editor should already be on your path such that you can run it by just typing its name at the prompt.

Notepad++ help can be found here

Diffing

git diff
git diff --staged
git diff HEAD

Git Add Patch Mode (Interactive)

git add -p
# answer s for split, y for yes, n for no

Limit View of History

git log --author=Matt
git log -3
git log --stat
git log -p

Restore to last committed state

git reset --hard

Git Similarity Index Discussion

http://permalink.gmane.org/gmane.comp.version-control.git/217

Student Questions

Git for "my" Team

  • I have to take what I already know of github (a fair working knowledge plus today's course) back to a team of 4-5 devs (2 remote)
  • They don't know github
  • I have to convince them why they should bother learning github
  • Be able to teach them enough so that we can all use it to work on our source code.

Collaboration

  • The one question I know I'm going to get the most is if we all have our own cloned versions of a private github repo, how does one developer know what the other devs are working on?

Binaries

  • What are the best practices for handling that especially for binary files like Flash FLAs?

Resetting

  • Can you reset an individual file?

      git checkout HEAD -- <FILENAMEORPATHNAME>
      git checkout -- pageuno.html
      git checkout HEAD -- pageuno.html
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment