Skip to content

Instantly share code, notes, and snippets.

@benplant
benplant / git_cheatsheet.md
Last active May 9, 2016 00:48 — forked from DannyCrews/git_cheatsheet.md
Git command cheatsheet from Michael Hartl's Learn Enough Git to be Dangerous

Getting started

Command Description Example
git help Get help on a command $ git help push
git config Configure Git $ git config --global …
source <file> Activate Bash changes $ source ~/.bash_profile
mkdir -p Make intermediate directories as necessary $ mkdir -p repos/website
git status Show the status of the repository $ git status
touch <name> Create empty file $ touch foo
git add -A Add all files or directories to staging area $ git add -A
@benplant
benplant / command_line_cheat_sheet.md
Created May 9, 2016 00:48 — forked from DannyCrews/command_line_cheat_sheet.md
A collection of the most useful command line commands per Michael Hartl's 'Learn Enough Command Line to be Dangerous'

Basics

Command Description Example
echo <string> Print string to screen $ echo hello
man <command> Display manual page for command $ man echo
⌃C Get out of trouble $ tail^C
⌃A Move to beginning of line
⌃E Move to end of line
⌃U Delete to beginning of line
Option-click Move cursor to location clicked

How-to setup a simple git push deployment

These are my notes basically. At first i created this gist just as a reminder for myself. But feel free to use this for your project as a starting point. If you have questions you can find me on twitter @thomasf

On the server (example.com)

  1. Create a user on example.com, as which we (the git client) connect (push) to exmaple.com.
sudo useradd -m -s /usr/bin/git-shell git