Skip to content

Commit d5650ad

Browse files
Update CONTRIBUTING.md (civictechindex#446)
Add more examples about git add. Clarify that Docker is optional (which is true for the time being). Co-authored-by: Olivia Chiong <[email protected]> Merged as agreed
1 parent 313b6f8 commit d5650ad

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed

CONTRIBUTING.md

+20-11
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,11 @@ You should now have a new folder called `CTI-website-frontend`.
7676

7777
_Note: Instead of working on a clone, you can choose to make edits on a fork. To view the previous instructions on how to do that, look at [the version of this document dated Jan 14, 2021](https://github.com/civictechindex/CTI-website-frontend/blob/c4320bc33f6eada97bf3f404d240cac382ee7552/CONTRIBUTING.md)._
7878

79-
## Step 4: Setting up Docker
79+
## Step 4: Setting up Docker (Optional)
8080

81-
Docker is the recommended approach to quickly getting started with local development. (Docker helps create a local/offline version of the `CTI-website-frontend` website on your computer so you can test out your code before submitting a pull request.)
81+
Docker will soon be the recommended approach to quickly getting started with local development, but this step is optional for now, and most devs are not using Docker.
82+
83+
Docker is a tool that can help create a local/offline version of the `CTI-website-frontend` website on your computer so you can test out your code before submitting a pull request.
8284

8385
The recommended installation method is [Docker Desktop](https://docs.docker.com/get-docker/) for Windows 10 64-bit and Mac. Linux users may check out [Docker Engine](https://docs.docker.com/engine/install/) instead.
8486

@@ -102,7 +104,7 @@ In browser go to [localhost:80](localhost:80)
102104

103105
Create a new branch for each issue you work on. Doing all your work on topic branches leaves the repository's main branch (named `main`) unmodified.
104106

105-
a) Check current branch
107+
### a) Check current branch
106108

107109
The `git branch` command will let you know what branch you are in, and what branch names are already in use.
108110

@@ -112,7 +114,7 @@ git branch
112114

113115
You will see a list of all of your branches. There will be a star (`*`) next to the branch that you are currently in. By default you should start on the `main` branch.
114116

115-
b) Create a new branch where you will work on your issue
117+
### b) Create a new branch where you will work on your issue
116118

117119
The `git checkout` command will create and change to a new branch where you will do the work on your issue. In git, the checkout command lets you navigate between different branches. Using the `-b` flag you can create a new branch and immediately switch into it.
118120

@@ -130,28 +132,35 @@ No law of physics will break if you don't adhere to this scheme, but laws of git
130132

131133
When you've finished working on your issue, follow the steps below to prepare your changes to push to GitHub.
132134

133-
c) Prepare your changes to push to the repository
135+
### c) Prepare your changes to push to the repository
134136

135137
Once you are done with the work on your issue you will push it to GitHub. Before you can push your work, you will stage and commit your changes. These two commands are similar to the save command that you have used to in other programs.
136138

137-
-Use the `git add` command to stage your changes.
138-
This command prepares your changes before you commit them. You can stage files one at a time using the filename, or you can use the `.` to stage all of the files that you have added or made changes to.
139+
#### Use the `git add` command to stage your changes
140+
141+
This command prepares your changes before you commit them. You can stage files one at a time using the filename, or many at a time using wildcards, or you can use the `.` to stage all of the files that you have added or made changes to. For more information on `git add`, see <https://github.com/git-guides/git-add>.
142+
143+
To stage changes to a specific file, run the command:
144+
145+
```bash
146+
git add path/to/file/you/just/edited.js
147+
```
139148

140-
Run the command:
149+
To stage all of the changes in your folder, run the command:
141150

142151
```bash
143152
git add .
144153
```
145154

146-
-Use the `git status` command to see what files are staged.
155+
#### Use the `git status` command to see what files are staged
147156

148157
This command will list the files that have been staged. These are the files that will be committed (saved) when you run the next command, `git commit`.
149158

150159
```bash
151160
git status
152161
```
153162

154-
-Use the `git commit` command
163+
#### Use the `git commit` command
155164

156165
This command saves your work, and prepares it to push to GitHub. Use the `-m` flag to quickly add a message to your commit. Your message should be a short description of the issue you are working. It will be extremely helpful if other people can understand your message, so try to resist the temptation to be overly cryptic.
157166

@@ -161,7 +170,7 @@ To commit your changes with a message, run:
161170
git commit -m 'insert message here'
162171
```
163172

164-
Congratulations! You are now ready to push your work to GitHub.
173+
### d) Congratulations! You are now ready to push your work to GitHub
165174

166175
## Step 6: Code quality
167176

0 commit comments

Comments
 (0)