Skip to content

Commit 1d7a6f4

Browse files
Inhishonornpjohnson
authored andcommitted
wiki: Move git instructions/resources to templates
Change-Id: Iefab48fcfd423a7fbd19ab2fc48597d0e8508477
1 parent 79d9756 commit 1d7a6f4

File tree

5 files changed

+83
-111
lines changed

5 files changed

+83
-111
lines changed

_includes/templates/git_resources.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
## Common commands
2+
3+
{% if page.tags contains "gerrit" %}
4+
5+
### `repo`
6+
7+
* `repo abandon <branch name>` to abandon any changes (commits) that have not been uploaded.
8+
9+
* `repo start <branch> <project>` to start repo listening for changes through git.
10+
11+
* `repo upload <project name>` to upload committed changes to the remote review server.
12+
13+
{% endif %}
14+
15+
### `git`
16+
17+
* `git add <file name>` to stage a file that has been changed or added.
18+
19+
* `git commit -m "comment"` to commit a change.
20+
21+
* `git reset HEAD <file name>` to unstage a file.
22+
23+
* `git revert HEAD` to undo the last commit.
24+
25+
* `git status` to see the status of a project.
26+
27+
### `git subcommands`
28+
29+
* `--date="DATE"` to specify the date of change if necessary. DATE has to be in RFC 2822, ISO 8601 or git internal time format.
30+
31+
Examples:
32+
33+
* RFC 2822: Wed, 17 Jan 2018 17:39:48 +0100
34+
35+
* ISO 8601: 2018-01-17T17:39:48+0100
36+
37+
* git internal format: 1516210788 +0100
38+
39+
40+
* `--author="NAME <EMAIL>"` to name the author if you did not write the patch yourself.
41+
42+
* `--amend` to modify the last commit.
43+
44+
## Resources
45+
46+
[Git Immersion](http://gitimmersion.com/)
47+
48+
[Git and repo overview](https://source.android.com/source/developing)
49+
50+
[Gerrit Documentation](https://review.lineageos.org/Documentation/index.html)

_includes/templates/git_setup.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#### Install Git
2+
3+
##### On Windows
4+
5+
Install [Git for Windows](https://git-for-windows.github.io/).
6+
7+
##### On macOS
8+
9+
Install Git using the [Git installer](https://git-scm.com/download/mac).
10+
11+
##### On Linux
12+
13+
You can install Git by running:
14+
15+
```
16+
sudo apt install git
17+
```
18+
19+
More specific instructions for different distributions can be found [here](https://git-scm.com/download/linux).
20+
21+
#### Configure Git
22+
23+
Run:
24+
25+
```
26+
git config --global user.name "Your Name"
27+
git config --global user.email "[email protected]"
28+
```

pages/contributing_wiki.md

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,34 +16,7 @@ If you already have a LineageOS source tree checked out, then this step is done
1616

1717
If you don't have a LineageOS source tree on your device, then you can clone the wiki from GitHub to any directory you like. In this example, we'll use `~/lineage_wiki`.
1818

19-
#### Install Git
20-
21-
##### On Windows
22-
23-
Install [Git for Windows](https://git-for-windows.github.io/).
24-
25-
##### On macOS
26-
27-
Install Git using the [Git installer](https://git-scm.com/download/mac).
28-
29-
##### On Linux
30-
31-
You can install Git by running:
32-
33-
```
34-
sudo apt install git
35-
```
36-
37-
More specific instructions for different distributions can be found [here](https://git-scm.com/download/linux).
38-
39-
#### Configure Git
40-
41-
Run:
42-
43-
```
44-
git config --global user.name "Your Name"
45-
git config --global user.email "[email protected]"
46-
```
19+
{% include templates/git_setup.md %}
4720

4821
{% include alerts/tip.html content="Before this step, you can fork the LineageOS wiki repository and work on your own copy. That way you can preview your changes online using GitHub pages, which [we've detailed below](#preview-using-github). Just fork the repo and then replace LineageOS in the `git clone` command with your GitHub username." %}
4922

pages/how-tos/submitting_to_gerrit.md

Lines changed: 2 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ redirect_from: submitting-patch-howto.html
66
permalink: /how-to/submitting-patches/
77
tags:
88
- how-to
9+
- gerrit
910
---
1011

1112

@@ -271,52 +272,4 @@ To make sure they get informed:
271272

272273
2) Set the [proper labels]({{ "how-to/using-gerrit#reviewing-a-patch" | relative_url }}) to indicate your patch is ready
273274

274-
## Common commands
275-
276-
See [Git Immersion](http://gitimmersion.com/) for more information.
277-
278-
### `repo`
279-
280-
* `repo abandon <branch name>` to abandon any changes (commits) that have not been uploaded.
281-
282-
* `repo start <branch> <project>` to start repo listening for changes through git.
283-
284-
* `repo upload <project name>` to upload committed changes to the remote review server.
285-
286-
287-
### `git`
288-
289-
* `git add <file name>` to stage a file that has been changed or added.
290-
291-
* `git commit -m "comment"` to commit a change.
292-
293-
* `git reset HEAD <file name>` to unstage a file.
294-
295-
* `git revert HEAD` to undo the last commit.
296-
297-
* `git status` to see the status of a project.
298-
299-
### `git subcommands`
300-
301-
* `--date="DATE"` to specify the date of change if necessary. DATE has to be in RFC 2822, ISO 8601 or git internal time format.
302-
303-
Examples:
304-
305-
* RFC 2822: Wed, 17 Jan 2018 17:39:48 +0100
306-
307-
* ISO 8601: 2018-01-17T17:39:48+0100
308-
309-
* git internal format: 1516210788 +0100
310-
311-
312-
* `--author="NAME <EMAIL>"` to name the author if you did not write the patch yourself.
313-
314-
* `--amend` to modify the last commit.
315-
316-
## Resources
317-
318-
[Git Immersion](http://gitimmersion.com/)
319-
320-
[Git and repo overview](https://source.android.com/source/developing)
321-
322-
[Gerrit Documentation](https://review.lineageos.org/Documentation/index.html)
275+
{% include templates/git_resources.md %}

pages/how-tos/using_gerrit.md

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ redirect_from: usinggerrit-howto.html
66
permalink: /how-to/using-gerrit/
77
tags:
88
- how-to
9+
- gerrit
910
---
1011

1112
## What is Gerrit?
@@ -85,37 +86,4 @@ Go ahead and build. When you're done, you'll hopefully have the feature you want
8586

8687
You can of course also contribute by submitting your own patch via Gerrit. Follow [this link]({{ "how-to/submitting-patches" | relative_url }}) to find out how to do it!
8788

88-
89-
## Common commands
90-
91-
See [Git Immersion](http://gitimmersion.com/) for more information.
92-
93-
### `repo`
94-
95-
* `repo abandon <branch name>` to abandon any changes (commits) that have not been uploaded.
96-
97-
* `repo start <branch> <project>` to start repo listening for changes through git.
98-
99-
* `repo upload <project name>` to upload committed changes to the remote review server.
100-
101-
102-
### `git`
103-
104-
* `git add <file name>` to stage a file that has been changed or added.
105-
106-
* `git commit -m "comment"` to commit a change.
107-
108-
* `git reset HEAD <file name>` to unstage a file.
109-
110-
* `git revert HEAD` to undo the last commit.
111-
112-
* `git status` to see the status of a project.
113-
114-
115-
## Resources
116-
117-
[Git Immersion](http://gitimmersion.com/)
118-
119-
[Git and repo overview](https://source.android.com/source/developing)
120-
121-
[Gerrit Documentation](https://review.lineageos.org/Documentation/index.html)
89+
{% include templates/git_resources.md %}

0 commit comments

Comments
 (0)