Mathjax javascript librry setup

Git Open Notebook

Tutorials and Books

Cheat Sheets

The following cheat sheets are generally based on what task you want to perform, and are pretty good for beginners:

Git Quick Reference Card, tex source, is a summary listing of commands. It’s not task based. Its easy to take the source and modify it to your liking, if you want.

Common Tasks

  • Create a new git repository in an existing directory:
    1
    2
    3
    4
    
    cd <root directory>
    git init
    git add .
    git commit -m "My first commit"
    
  • Attaching a local repository to a remote:
    1
    2
    3
    4
    5
    
    # Create a "bare repository" for your remote. GitHub, BitBucket, etc have a web page form you fill out to do this.
    mkdir <proj.git>
    cd <proj.git>
    git --bare init
    touch <proj.git>/git-daemon-export-ok  # only do this if you want the project to be accessible from the git protocol
    
  • Change the URL of a repository’s origin. This is useful when you create a new project by cloning a template.
    1
    2
    3
    4
    5
    
    git clone git@bitbucket.org:abbourne/defaultscalaproject.git
    ## Then edit the default template
    
    
    git remote set-url origin git@bitbucket.org:abbourne/scalakatas.git
    
  • Push your initial contents to the central server with
    1
    2
    3
    
    git remote add origin <ssh://git@bitbucket.org/abbourne/bcp-octopress.git> # add the remote repository as the origin
    git push -u origin --all # pushes up the repo and its refs for the first time
    git push -u origin --tags # pushes up any tags
    
  • Clone an existing repository (typically a remote repository)
    1
    2
    
    cd <directory above where you want to put your clone>
    git clone <git://server/path/to/files>  # Could be local, SSH, or HTTPS
    

Comments