Skip to content

Commit f89ed2e

Browse files
committed
Merge branch 'master' of github.com:GoogleCloudPlatform/java-repo-tools into lint
1 parent dd718e0 commit f89ed2e

File tree

1 file changed

+22
-25
lines changed

1 file changed

+22
-25
lines changed

README.md

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,19 @@ git checkout master
4141
# Making a new branch ia optional, but recommended to send a pull request to
4242
# start using java-repo-tools.
4343
git checkout -b use-java-repo-tools
44+
```
45+
46+
So that we can pull future updates from the `java-repo-tools` repository, we
47+
merge histories. This way we won't get unnecessary conflicts when pulling changes
48+
in.
49+
50+
```
51+
git merge -s ours --no-commit java-repo-tools/master
52+
```
53+
54+
Finally, read the `java-repo-tools` into a subtree.
55+
56+
```
4457
git read-tree --prefix=java-repo-tools/ -u java-repo-tools
4558
```
4659

@@ -82,17 +95,13 @@ now-redundant plugin information.
8295
If you haven't done this before, run
8396

8497
```
85-
git remote add java-repo-tools
86-
git@github.com:GoogleCloudPlatform/java-repo-tools.git
87-
git fetch java-repo-tools master
88-
# Optional, but it makes pushing changes upstream easier.
89-
git checkout -b java-repo-tools java-repo-tools/master
98+
git remote add java-repo-tools git@github.com:GoogleCloudPlatform/java-repo-tools.git
9099
```
91100

92101
To detect if you have changes in the directory, run
93102

94103
```
95-
git fetch java-repo-tools
104+
git fetch java-repo-tools master
96105
git diff-tree -p HEAD:java-repo-tools/ java-repo-tools/master
97106
```
98107

@@ -111,33 +120,17 @@ directory.)
111120
To update the `java-repo-tools` directory, if you haven't done this before, run
112121

113122
```
114-
git remote add java-repo-tools
115-
git@github.com:GoogleCloudPlatform/java-repo-tools.git
116-
git fetch java-repo-tools master
117-
git checkout -b java-repo-tools java-repo-tools/master
118-
```
119-
120-
To pull the changes when in this branch run
121-
122-
```
123-
git pull java-repo-tools master
124-
```
125-
126-
To pull the changes back from upstream:
127-
128-
```
129-
git checkout java-repo-tools
130-
git pull java-repo-tools master
123+
git remote add java-repo-tools git@github.com:GoogleCloudPlatform/java-repo-tools.git
131124
```
132125

133-
Pull them into the main code.
126+
To pull the latest changes from this `java-repo-tools` repository, run:
134127

135128
```
136129
git checkout master
137130
# Making a new branch is optional, but recommended to send a pull request for
138131
# update.
139132
git checkout -b update-java-repo-tools
140-
git merge --squash -Xsubtree=java-repo-tools/ --no-commit java-repo-tools
133+
git pull -s subtree java-repo-tools master
141134
```
142135

143136
Then you can make any needed changes to make the rest of the repository
@@ -171,6 +164,10 @@ git push java-repo-tools java-repo-tools:name-for-remote-branch
171164
Then, you can send a pull request to the `java-repo-tools` repository.
172165

173166

167+
## References
168+
169+
- [GitHub's subtree merge reference](https://help.github.com/articles/about-git-subtree-merges/)
170+
174171
## Contributing changes
175172

176173
- See [CONTRIBUTING.md](CONTRIBUTING.md)

0 commit comments

Comments
 (0)