Difference between revisions of "How To Use Git"

From Genome Analysis Wiki
Jump to navigationJump to search
(Add helps)
Line 19: Line 19:
 
We use GitHub to host our software repositories - take a look at a brief overview
 
We use GitHub to host our software repositories - take a look at a brief overview
 
*[[Media: GitHub.pdf|GitHub]]
 
*[[Media: GitHub.pdf|GitHub]]
 +
 +
 +
= Git Terms =
 +
* Repository - holds files and their history
 +
** Bare repository - no visible files, just the database that holds the stored information
 +
* Clone - copy a repository
 +
* Local/working - the directory/repository where you make your changes/work in
 +
* Remote/source - the repository that your local/working repository was cloned from/where you send your completed changes.
 +
* Commit - a version/revision of your repository or the act of creating a version/revision
 +
** on a commit, changes are only stored in the local/working repository
 +
* Pull - update your local/working repository with any changes that have been made to the remote/source (you do not automatically see the changes)
 +
* Push - update the remote/source with changes that you have made in your local/working repository
 +
* Branch - alternate paths of work that allows you to commit/push/pull without affecting the other paths
 +
* Master - the main/default branch
 +
* Merge - bring in changes from another branch
 +
  
  
Line 24: Line 40:
  
 
== How Do I...==
 
== How Do I...==
 +
=== Learn how a specific command works ===
 +
{|border="1"
 +
! Command
 +
! Example
 +
|-
 +
| git help <command>
 +
| git help clone
 +
|-
 +
| man git-<command>
 +
| man git-clone
 +
|-
 +
| git-<command> -h
 +
| git-clone -h
 +
|}
 
=== [[Turn an already existing directory into a Git Repository]] ===
 
=== [[Turn an already existing directory into a Git Repository]] ===
 
=== [[Turn an already existing directory into a Git Repository#Create a remote bare Git repository for a repository to push to/pull from|Create a remote bare Git repository for a repository to push to/pull from]] ===
 
=== [[Turn an already existing directory into a Git Repository#Create a remote bare Git repository for a repository to push to/pull from|Create a remote bare Git repository for a repository to push to/pull from]] ===
  
 
More - COMING SOON!
 
More - COMING SOON!

Revision as of 14:46, 9 September 2011

Some useful suggestions/links/information on how to use git.

Learning Git

Presentations

If you want to use a GUI, one option is: SmartGit GUI

Practical

Using Git Example

Cheat Sheet

GitHub

We use GitHub to host our software repositories - take a look at a brief overview


Git Terms

  • Repository - holds files and their history
    • Bare repository - no visible files, just the database that holds the stored information
  • Clone - copy a repository
  • Local/working - the directory/repository where you make your changes/work in
  • Remote/source - the repository that your local/working repository was cloned from/where you send your completed changes.
  • Commit - a version/revision of your repository or the act of creating a version/revision
    • on a commit, changes are only stored in the local/working repository
  • Pull - update your local/working repository with any changes that have been made to the remote/source (you do not automatically see the changes)
  • Push - update the remote/source with changes that you have made in your local/working repository
  • Branch - alternate paths of work that allows you to commit/push/pull without affecting the other paths
  • Master - the main/default branch
  • Merge - bring in changes from another branch


Git FAQs

How Do I...

Learn how a specific command works

Command Example
git help <command> git help clone
man git-<command> man git-clone
git-<command> -h git-clone -h

Turn an already existing directory into a Git Repository

Create a remote bare Git repository for a repository to push to/pull from

More - COMING SOON!