Git Cheat Sheet

April 11, 2009 § 1 Comment

A couple of notes for myself and readers about Git:

  • Git does not allow you to add empty directory.
  • Do not forget to do initial commit when starting a new repository. Otherwise you will get: error: src refspec master does not match any. Reference: here.
  • There are a couple of configurations need to be set before performing git pull:
    git config branch.master.merge 'refs/heads/master' and 
    git config branch.master.remote 'origin'
    
  • How to ignore files? Read here.
  • The best Git GUI on OS X is: GitX.
  • Git cheat sheet by GitHub: [link]

If you are SVN users:

  • git checkout is not what you think. The functionality that you might want is git clone.
  • git checkout is used to switch branch or re-checkout a file.
  • git commit is not what you think. The command only do local commit. To push to ‘central‘ repo, you want to do git commit followed by git push.
Advertisements

Tagged:

§ One Response to Git Cheat Sheet

  • atma says:

    Man thank you, most howto’s on the web suck. You pointed out the two little commands that saved me.

    respect.

    ps. I’ll write a quick howto on my blog just to have it handy… blah

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

What’s this?

You are currently reading Git Cheat Sheet at RAPD.

meta

%d bloggers like this: