@@ -203,21 +203,27 @@ They are just regular files and directories. This is in contrast to `submodule`
203203There are two synchronization directions: ` subtree push ` and ` subtree pull ` .
204204
205205```
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
207207```
208208
209209takes all the changes that
210210happened 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.
212216
213217```
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
215219```
216220
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.
217224
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.
221227While definitely possible to resolve conflicts during a pull, you may have to redo the conflict
222228resolution if your PR doesn't get merged fast enough and there are new conflicts. Do not try to
223229rebase the result of a ` git subtree pull ` , rebasing merge commits is a bad idea in general.
0 commit comments