diff --git a/docs/git/cheat-sheet.md b/docs/git/cheat-sheet.md index 993fc1fb42..9d1bf4d627 100644 --- a/docs/git/cheat-sheet.md +++ b/docs/git/cheat-sheet.md @@ -75,7 +75,10 @@ See also [fixing commits][fix-commit] - log - `git log`: show commit logs - pull - - **do not use for Zulip** + - `git pull --rebase`: rebase your changes on top of master. + - `git pull` (with no options): Will either create a merge commit + (which you don't want) or do the asme as `git pull --rebase`, + depending on [whether you're configured Git properly][git-clone-config] - push - `git push origin +branch-name`: push your commits to your origin repository - rebase @@ -98,3 +101,4 @@ See also [fixing commits][fix-commit] - `git status`: show the working tree status, unstaged and staged files [fix-commit]: fixing-commits.html +[git-config-clone]: cloning.html#step-1b-clone-to-your-machine diff --git a/docs/git/cloning.md b/docs/git/cloning.md index 8a6ce761ec..8f697aaf21 100644 --- a/docs/git/cloning.md +++ b/docs/git/cloning.md @@ -42,6 +42,11 @@ pull.rebase true`, or just be careful to always run `git pull Note: If you receive an error while cloning, you may not have [added your ssh key to GitHub][github-help-add-ssh-key]. +Once the repository is cloned, we recommend running +[setup-git-repo][zulip-rtd-tools-setup] to install Zulip's pre-commit +hook which runs the Zulip linters on the changed files when you +commit. + ## Step 1c: Connect your fork to Zulip upstream Next you'll want to [configure an upstream remote @@ -133,3 +138,4 @@ Zulip. ([See screen cast](../_static/zulip-travisci.gif).) [travis-ci-profile]: https://travis-ci.org/profile [zulip-rtd-dev-first-time]: ../development/setup-vagrant.html [zulip-rtd-dev-overview]: ../development/overview.html +[zulip-rtd-tools-setup]: ../git/zulip-tools.html#set-up-git-repo-script diff --git a/docs/git/reviewing.md b/docs/git/reviewing.md index c287ed8778..2de499bcbd 100644 --- a/docs/git/reviewing.md +++ b/docs/git/reviewing.md @@ -1,5 +1,9 @@ # Review changes +**Note** - The following section covers reviewing changes on your local +clone. Please read the section on [code reviews][zulip-rtd-review] for a guide +on reviewing changes by other contributors. + ## Changes on (local) working tree Display changes between index and working tree (what is not yet staged for commit): @@ -56,3 +60,5 @@ Display changes you've committed so far since creating a branch from upstream/ma ``` $ git diff upstream/master...HEAD ``` + +[zulip-rtd-review]: ../contributing/code-reviewing.html diff --git a/docs/git/zulip-tools.md b/docs/git/zulip-tools.md index fcafabe17d..209fc66c12 100644 --- a/docs/git/zulip-tools.md +++ b/docs/git/zulip-tools.md @@ -1,14 +1,16 @@ # Zulip-specific tools -This section will document the zulip-specific git tools contributors will find helpful. +This article documents several useful tools that can save you a lot of +time when working with Git on the Zulip project. ## Set up git repo script -In the `tools` directory of [zulip/zulip][github-zulip-zulip] you'll find a -bash script `setup-git-repo`. This script installs the Zulip pre-commit hook. -This hook will run each time you `git commit` to automatically run linters, -etc. The hook passes no matter the result of the linter, but you should still -pay attention to any notices or warnings it displays. +In the `tools` directory of [zulip/zulip][github-zulip-zulip] you'll +find a bash script `setup-git-repo`. This script installs the Zulip +pre-commit hook. This hook will run each time you `git commit` to +automatically run Zulip's linters on just the files that the commit +modifies. The hook passes no matter the result of the linter, but you +should still pay attention to any notices or warnings it displays. It's simple to use. Make sure you're in the clone of zulip and run the following: diff --git a/docs/tutorials/shell-tips.md b/docs/tutorials/shell-tips.md index 8fc5dc676f..bbbedf22ef 100644 --- a/docs/tutorials/shell-tips.md +++ b/docs/tutorials/shell-tips.md @@ -347,4 +347,4 @@ will be useful in your journey, as well. ![Git - XKCD 1597](https://imgs.xkcd.com/comics/git.png) -[git-cheat-detailed]: git-cheat-sheet-detailed.html +[git-cheat-detailed]: ../git/cheat-sheet.html#detailed-cheat-sheet