@@ -41,6 +41,19 @@ git checkout master
41
41
# Making a new branch ia optional, but recommended to send a pull request to
42
42
# start using java-repo-tools.
43
43
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
+ ```
44
57
git read-tree --prefix=java-repo-tools/ -u java-repo-tools
45
58
```
46
59
@@ -82,17 +95,13 @@ now-redundant plugin information.
82
95
If you haven't done this before, run
83
96
84
97
```
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
90
99
```
91
100
92
101
To detect if you have changes in the directory, run
93
102
94
103
```
95
- git fetch java-repo-tools
104
+ git fetch java-repo-tools master
96
105
git diff-tree -p HEAD:java-repo-tools/ java-repo-tools/master
97
106
```
98
107
@@ -111,33 +120,17 @@ directory.)
111
120
To update the ` java-repo-tools ` directory, if you haven't done this before, run
112
121
113
122
```
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
131
124
```
132
125
133
- Pull them into the main code.
126
+ To pull the latest changes from this ` java-repo-tools ` repository, run:
134
127
135
128
```
136
129
git checkout master
137
130
# Making a new branch is optional, but recommended to send a pull request for
138
131
# update.
139
132
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
141
134
```
142
135
143
136
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
171
164
Then, you can send a pull request to the ` java-repo-tools ` repository.
172
165
173
166
167
+ ## References
168
+
169
+ - [ GitHub's subtree merge reference] ( https://help.github.com/articles/about-git-subtree-merges/ )
170
+
174
171
## Contributing changes
175
172
176
173
- See [ CONTRIBUTING.md] ( CONTRIBUTING.md )
0 commit comments