Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jwest80/learn-git
Learning git for the first time
https://github.com/jwest80/learn-git
Last synced: 8 days ago
JSON representation
Learning git for the first time
- Host: GitHub
- URL: https://github.com/jwest80/learn-git
- Owner: jwest80
- Created: 2010-10-29T14:02:08.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2018-07-06T17:53:12.000Z (over 6 years ago)
- Last Synced: 2023-03-11T10:41:49.448Z (over 1 year ago)
- Language: HTML
- Homepage:
- Size: 6.84 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
README - Learn-git
-------------------------------
Version 1.0.0For Installation Instructions and Explanation of the following
notes... Read the git Quick Start Guide: http://help.github.com/For more in-depth reserch of git tool go to http://progit.org/
* Get a local copy of the project.
* git clone [url]
Examples: $ git clone [email protected]:jwest80:Learn-git.git
$ git clone [email protected]:auditconf/auditconfirmations.git
** Basic Snapshotting
* git add - Start tracking new file or changes to a file
(Adds file to Staging area)
* -A : Adds all files being tracked to staging area.
* git status - To be commited and New or Modified Files
not in staging area.
* git diff - Shows differences between files
(Opens in vi, type :q to quit)
* git commit - Records a snapshot of staging area
Example: $git commit -m 'I made some changes'
(leaving off the -m will open vim for you to add comments)
* reset Head - "unstages" a file or reverts the file to
what it was before we started modifying things.
* rm - will remove the file from the staging area entirely and
from your disk (effectivly deleting it). You can keep it on
the disk by using rm --cached.
*
* Branching and Merging
* git branch - Used to List (default), Create, Remove, and
Switch Branch Context.
* [branchname] : Create a new Branch from last Commit. This
is like a bookmark of a snapshot that we can return to
at any point.
* -d [branchname] : Delete a branch.
* git checkout [branchname] - Open/Switch to branch.
* -b : Creates a new branch and opens it.
* git merge - Merge a branch context into your current branch. For
more info on merge conflicts go to http://gitref.org/branching/
*
* Logs and Tags
* git log - Shows the commit history or a branch.
(Opens in vi, type :q to quit)
* --oneline : Shows a compact version.
* --graph : Creates a topology graph (can be used with oneline)
* --decorate : Shows tags and other info (pretty colors)
* git tag -a [message] - Tags a point in history as important.
(Always use the -a when tagging to get who,when,why)
* You can add tag to old commit using the commit SHA
Example: $ git tag -a v0.1 [SHA]
*
* Sharing and Updating Projects
* git remote - Used to List (default), Add, Remove, Fetch, Pull,
and Push Remote Repositories.
* -v : Show URLs in List
* add [alias] [url] : Adds a remote project alias
* rm [alias] : Removes a remote project alias
* git fetch [alias] - Update from a remote repository
* git pull [alias] - Does a "get fetch" followed by a
"get merge" (This is the lazy (wo)man's way, and could cause
problems)
* git push [alias] [branch] - push branches to a remote repository
*
* Other Tips
* Add an alias (Does not seem to working with Windows Version)
$ config --global alias.unstage "reset HEAD"
(Now you can unstage like this git unstage --[file] instead o
f git reset HEAD --[file])
* Turn Coloring On
$ git config --global color.ui true
*