Basic Git commands

Hey, everyone,

I’m back with another post. First post of this month. 🙂
This post is intended to be a “post it”.. I mean, a kinda catalog just to help you remember basic Git commands, but essential. So, let’s be straight as I always tend to be.

Commit all changed files at once:

$ git commit -a -m 'comment for all modified files'

Save changes into remote repository (master branch):

$ git push origin -u master

Change local repository to master branch:

$ git checkout

Download from remote repository:

$ git pull

Fetch a specific commit from remote repository (The last argument for ‘fetch’ is an SHA1 key. Check your remote repository to figure out.):

$ git fetch git://my_repository/code.git c89d9088cf645cc7235906a59b444b12fbbb563d
$ git checkout FETCH_HEAD

Hope you enjoyed it,
That’s all, ’till next time.

Advertisements

2 thoughts on “Basic Git commands

  1. Pingback: Basic Git commands [part 2] | blog_do_airton += coisa_nova;
  2. Pingback: Basic Git commands [part 3] | blog_do_airton += coisa_nova;

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