Git: Difference between revisions
Jump to navigation
Jump to search
Adamcolton (talk | contribs) |
Adamcolton (talk | contribs) |
||
| Line 17: | Line 17: | ||
* fetch | * fetch | ||
* merge : combine two pranches | * merge : combine two pranches | ||
* push | * push : pushes to remove - I'm not clear which, how, what if there are multiple - much confusion. | ||
* remote | * remote | ||
* add origin (url) | * add origin (url) | ||
Revision as of 19:09, 6 June 2013
Commands
Standards Used: these are git commands, there for they come after "git". Anything in parenthesis are arguments, the parenthesis are not included. Anything after : is an explanation.
- status : shows unstaged changes
- add (filename) : stages a change
- add * : stages all changes
- reset (filename) : Unstages a change
- commit : commit staged changes
- -m ("comment")
- log : shows the history of the repository
- checkout (id)
- checkout master : returns to the latest changes
- reset (id) : erases all history after (id), basically a rollback
- help : list all commands
- help (operation/keyword) get help on a specific command
- clone
- fetch
- merge : combine two pranches
- push : pushes to remove - I'm not clear which, how, what if there are multiple - much confusion.
- remote
- add origin (url)
- pull : really just a shortcut for fetch then merge
Examples
cd /path/to/your/Workbench/repo git remote add origin https://your_repo_identity_here/online_workbench.git git push -u origin master
Concepts
Repository
The Git representation of the history of a set of files in a directory tree.
Stage
Changes are made locally, staged and then committed. Staging is the process of preparing part (or all) of your change to be committed.
Checkout
This is not like the MS version - you are not getting a file to edit it, you are pulling a previous version of a file.
Remote
A git server. This is where I get confused.
Origin
...and origin master...more confused