Skip to content

Instantly share code, notes, and snippets.

@obfusk
Forked from noxqsgit/git.md
Last active December 26, 2015 02:09
Show Gist options
  • Save obfusk/7076026 to your computer and use it in GitHub Desktop.
Save obfusk/7076026 to your computer and use it in GitHub Desktop.
git basics

Learn to use git

--> http://try.github.com

Use git for your project

$ cd /path/to/your/project
$ git init .

Add a github or bitbucket remote (?!)

$ git remote add origin git@$HOST:$USER/$REPO.git
$ git push origin -u --all  # first push

Status

$ git status

Development

1. Add files

$ git add .                 # add all files in this directory, recursively
$ git add -u                # add all modified files and remove deleted ones

2. Commit

$ git commit -a -m '... message ...'
                            # -a adds all modified files, so you don't need to git add them

3. Push

$ git push

Links

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