@@ -203,21 +203,27 @@ 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 https:// github.com/rust-lang /rust-clippy.git
206
+ git subtree push -P src/tools/clippy git@ github.com:your-github-name /rust-clippy rustup
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
- changes (so every local commit that touched the subtree causes a commit on the remote repo).
211
+ changes. Every local commit that touched the subtree causes a commit on the remote repo, but is
212
+ modified to move the files from the specified directory to the tool repo root.
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.
212
216
213
217
```
214
- git subtree pull -P src/tools/clippy https://github.com/rust-lang/rust-clippy.git
218
+ git subtree pull -P src/tools/clippy https://github.com/rust-lang/rust-clippy master
215
219
```
216
220
221
+ takes all changes since the last ` subtree pull ` from the tool repo
222
+ repo and adds these commits to the rustc repo + a merge commit that moves the tool changes into
223
+ the specified directory in the rust repository.
217
224
218
- takes all changes since the last ` subtree pull ` from the clippy
219
- repo and adds these commits to the rustc repo + a merge commit with the existing changes.
220
- It is recommended that you always do a push before a pull, so that the merge works without conflicts.
225
+ It is recommended that you always do a push first and get that merged to the tool master branch.
226
+ Then, when you do a pull, the merge works without conflicts.
221
227
While definitely possible to resolve conflicts during a pull, you may have to redo the conflict
222
228
resolution if your PR doesn't get merged fast enough and there are new conflicts. Do not try to
223
229
rebase the result of a ` git subtree pull ` , rebasing merge commits is a bad idea in general.
0 commit comments