% CHEATSHEET(7) Version 1.0 | Cheatsheet for stuff Hugh forgets
% Hugh Rundle
NAME
====
**cheatsheet** - tips and reminders for Hugh.
DESCRIPTION
===========
This is a man page to remind Hugh of some basic commands and techniques he uses but forgets a lot in git, Python etc.
EXAMPLES
========
**git**
`git branch -d [name of branch to delete]`
: Delete a git branch
`git reset [file]`
: *Unstage* file but retain contents
`git _reset_ [commit]`
: *Undo* all commits after *commit*, preserving changes locally
`git reset HEAD --hard`
: *Undo* all changes to tracked files (since last commit)
`git clone [url]`
: Download project and its history
`git merge [branch]`
: Merge changes from *branch* into the current local branch
`git fetch [remote] pull/[id]/head:[branchname]`
: Where *remote* is the remote name you want to fetch from, *id* is the PR id, and *branchname* is the name you want to give to the new LOCAL branch you will create with this command. e.g. *fetch bookwyrm pull/999/head:testing*
: Push a change to someone else's pull request. Where *localBranch* is the branch name in your local repository, and *remoteBranch* is **their** branch name. More info at https://codinhood.com/micro/add-commits-persons-pr-on-your-repo/