docs: Add syntax highlighting languages to code blocks.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2021-08-19 22:09:04 -07:00
committed by Tim Abbott
parent 8fd89f87e0
commit b29b6f6526
62 changed files with 732 additions and 630 deletions

View File

@@ -26,7 +26,7 @@ A merge commit is usually created when you've run `git pull` or `git merge`.
You'll know you're creating a merge commit if you're prompted for a commit
message and the default is something like this:
```
```text
Merge branch 'master' of https://github.com/zulip/zulip
# Please enter a commit message to explain why this merge is necessary,
@@ -38,7 +38,7 @@ Merge branch 'master' of https://github.com/zulip/zulip
And the first entry for `git log` will show something like:
```
```console
commit e5f8211a565a5a5448b93e98ed56415255546f94
Merge: 13bea0e e0c10ed
Author: Christie Koehler <ck@christi3k.net>
@@ -52,7 +52,7 @@ Some graphical Git clients may also create merge commits.
To undo a merge commit, first run `git reflog` to identify the commit you want
to roll back to:
```
```console
$ git reflog
e5f8211 HEAD@{0}: pull upstream master: Merge made by the 'recursive' strategy.
@@ -67,7 +67,7 @@ by `git pull` and `13bea0e HEAD@{1}:` is the last commit I made before running
Once you'd identified the ref you want to revert to, you can do so with [git
reset][gitbook-reset]:
```
```console
$ git reset --hard 13bea0e
HEAD is now at 13bea0e test commit for docs.
```
@@ -86,7 +86,7 @@ just keep in mind that this changes as you run git commands.
Now when you look at the output of `git reflog`, you should see that the tip of your branch points to your
last commit `13bea0e` before the merge:
```
```console
$ git reflog
13bea0e HEAD@{2}: reset: moving to HEAD@{1}
@@ -96,7 +96,7 @@ e5f8211 HEAD@{3}: pull upstream master: Merge made by the 'recursive' strategy.
And the first entry `git log` shows is this:
```
```console
commit 13bea0e40197b1670e927a9eb05aaf50df9e8277
Author: Christie Koehler <ck@christi3k.net>
Date: Mon Oct 10 13:25:38 2016 -0700
@@ -114,14 +114,14 @@ with `git cherry-pick` ([docs][gitbook-git-cherry-pick]).
For example, let's say you just committed "some work" and your `git log` looks
like this:
```
```console
* 67aea58 (HEAD -> master) some work
* 13bea0e test commit for docs.
```
You then mistakenly run `git reset --hard 13bea0e`:
```
```console
$ git reset --hard 13bea0e
HEAD is now at 13bea0e test commit for docs.
@@ -133,7 +133,7 @@ And then realize you actually needed to keep commit 67aea58. First, use `git
reflog` to confirm that commit you want to restore and then run `git
cherry-pick <commit>`:
```
```console
$ git reflog
13bea0e HEAD@{0}: reset: moving to 13bea0e
67aea58 HEAD@{1}: commit: some work
@@ -159,7 +159,7 @@ change to a part of the file I also want to change. When I try to bring my
branch up to date with `git fetch` and then `git rebase upstream/master`, I see
the following:
```
```console
First, rewinding head to replay your work on top of it...
Applying: test change for docs
Using index info to reconstruct a base tree...
@@ -181,7 +181,7 @@ after bringing in the new commits from upstream/master.
Running `git status` also gives me some information:
```
```console
rebase in progress; onto 5ae56e6
You are currently rebasing branch 'docs-test' on '5ae56e6'.
(fix conflicts and then run "git rebase --continue")
@@ -203,7 +203,7 @@ and `>>>>>>>`) markers to indicate where in files there are conflicts.
Tip: You can see recent changes made to a file by running the following
commands:
```
```bash
git fetch upstream
git log -p upstream/master -- /path/to/file
```
@@ -214,7 +214,7 @@ you are rebasing.
Once you've done that, save the file(s), stage them with `git add` and then
continue the rebase with `git rebase --continue`:
```
```console
$ git add README.md
$ git rebase --continue
@@ -240,7 +240,7 @@ where you committed them.
So, before you stop working for the day, or before you switch computers, push
all of your commits to GitHub with `git push`:
```
```console
$ git push origin <branchname>
```
@@ -253,7 +253,7 @@ But if you're switching to another computer on which you have already cloned
Zulip, you need to update your local Git database with new refs from your
GitHub fork. You do this with `git fetch`:
```
```console
$ git fetch <usermame>
```
@@ -261,7 +261,7 @@ Ideally you should do this before you have made any commits on the same branch
on the second computer. Then you can `git merge` on whichever branch you need
to update:
```
```console
$ git checkout <my-branch>
Switched to branch '<my-branch>'