Files
zulip/docs/tutorials/git-cheat-sheet.md
David Rosa Tamsen 7072fa5b37 docs: Reorganize developer docs to improve navigation.
This commit helps reduce clutter on the navigation sidebar.
Creates new directories and moves relevant files into them.
Modifies index.rst, symlinks, and image paths accordingly.

This commit also enables expandable/collapsible navigation items,
renames files in docs/development and docs/production,
modifies /tools/test-documentation so that it overrides a theme setting,
Also updates links to other docs, file paths in the codebase that point
to developer documents, and files that should be excluded from lint tests.

Note that this commit does not update direct links to
zulip.readthedocs.io in the codebase; those will be resolved in an
upcoming follow-up commit (it'll be easier to verify all the links
once this is merged and ReadTheDocs is updated).

Fixes #5265.
2017-11-16 09:45:08 -08:00

53 lines
1021 B
Markdown

# Git Cheat Sheet
See also [fixing commits][fix-commit]
Commands:
- add
- `git add foo.py`
- checkout
- `git checkout -b new-branch-name`
- `git checkout master`
- `git checkout old-branch-name`
- commit
- `git commit --amend`
- config
- `git config --global core.editor nano`
- `git config --global core.symlinks true`
- diff
- `git diff`
- `git diff --cached`
- `git diff HEAD~2..`
- fetch
- `git fetch origin`
- `git fetch upstream`
- grep
- `git grep update_unread_counts -- '*.js'`
- log
- `git log`
- pull
- **do not use for Zulip**
- push
- `git push origin +branch-name`
- rebase
- `git rebase -i HEAD~3`
- `git rebase -i master`
- `git rebase upstream/master`
- reflog
- `git reflog | head -10`
- remote
- `git remote -v`
- reset
- `git reset HEAD~2`
- rm
- `git rm oops.txt`
- show
- `git show HEAD`
- `git show HEAD~~~`
- `git show master`
- status
- `git status`
[fix-commit]: fixing-commits.html