@@ -203,16 +203,16 @@ They are just regular files and directories. This is in contrast to `submodule`
203
203
There are two synchronization directions: ` subtree push ` and ` subtree pull ` .
204
204
205
205
```
206
- git subtree push -P src/tools/clippy git@github.com:your-github-name/rust-clippy rustup
206
+ git subtree push -P src/tools/clippy git@github.com:your-github-name/rust-clippy sync-from-rust
207
207
```
208
208
209
209
takes all the changes that
210
210
happened to the copy in this repo and creates commits on the remote repo that match the local
211
211
changes. Every local commit that touched the subtree causes a commit on the remote repo, but is
212
212
modified to move the files from the specified directory to the tool repo root.
213
213
214
- Make sure to not pick the ` master ` branch, so you can open a normal PR to the tool to merge that
215
- subrepo push.
214
+ Make sure to not pick the ` master ` branch on the tool repo , so you can open a normal PR to the tool
215
+ to merge that subrepo push.
216
216
217
217
```
218
218
git subtree pull -P src/tools/clippy https://github.com/rust-lang/rust-clippy master
@@ -224,20 +224,21 @@ the specified directory in the rust repository.
224
224
225
225
It is recommended that you always do a push first and get that merged to the tool master branch.
226
226
Then, when you do a pull, the merge works without conflicts.
227
- While definitely possible to resolve conflicts during a pull, you may have to redo the conflict
227
+ While it's definitely possible to resolve conflicts during a pull, you may have to redo the conflict
228
228
resolution if your PR doesn't get merged fast enough and there are new conflicts. Do not try to
229
229
rebase the result of a ` git subtree pull ` , rebasing merge commits is a bad idea in general.
230
230
231
231
You always need to specify the ` -P ` prefix to the subtree directory and the corresponding remote
232
232
repository. If you specify the wrong directory or repository
233
233
you'll get very fun merges that try to push the wrong directory to the wrong remote repository.
234
- Luckily you can just abort this without any consequences and try again. It is usually fairly obvious
234
+ Luckily you can just abort this without any consequences by throwing away either the pulled commits
235
+ in rustc or the pushed branch on the remote and try again. It is usually fairly obvious
235
236
that this is happening because you suddenly get thousands of commits that want to be synchronized.
236
237
237
238
#### Creating a new subtree dependency
238
239
239
240
If you want to create a new subtree dependency from an existing repository, call (from this
240
- repository's root directory!! )
241
+ repository's root directory!)
241
242
242
243
```
243
244
git subtree add -P src/tools/clippy https://github.com/rust-lang/rust-clippy.git master
@@ -247,7 +248,7 @@ This will create a new commit, which you may not rebase under any circumstances!
247
248
and redo the operation if you need to rebase.
248
249
249
250
Now you're done, the ` src/tools/clippy ` directory behaves as if clippy were part of the rustc
250
- monorepo, so no one but you (or others that synchronize subtrees) needs actually use ` git subtree ` .
251
+ monorepo, so no one but you (or others that synchronize subtrees) actually needs to use ` git subtree ` .
251
252
252
253
253
254
### External Dependencies (submodules)
0 commit comments