You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ydb/docs/en/core/development/suggest-change.md
+83-43
Original file line number
Diff line number
Diff line change
@@ -98,43 +98,40 @@ And copy-paste the shown token to complete the GitHub CLI configuration.
98
98
99
99
YDB official repository is [https://github.com/ydb-platform/ydb](https://github.com/ydb-platform/ydb), located under the YDB organization account `ydb-platform`.
100
100
101
-
Create working dir:
101
+
To work on the {{ ydb-short-name }} code changes, you need to create a fork repository under your GitHub account. Create a fork by pressing the `Fork` button on the [official {{ ydb-short-name }} repository page](https://github.com/ydb-platform/ydb).
102
+
103
+
After your fork is set up, create a local git repository with two remotes:
104
+
-`official`: official {{ ydb-short-name }} repository, for main and stable branches
105
+
-`fork`: your {{ ydb-short-name }} repository fork, for your development branches
Once completed, you have a YDB Git repository fork cloned to `~/ydbwork/ydb`.
118
+
Once completed, you have a {{ ydb-short-name }} Git repository set up in `~/ydbwork/ydb`.
119
+
120
+
Forking a repository is an instant action, however cloning to the local machine takes some time to transfer about 650 MB of repository data over the network.
120
121
121
-
-git
122
+
Next, let's configure the default `git push` behavior:
122
123
123
-
On https://github.com/ydb-platform/ydb press Fork (Fork your own copy of ydb-platform/ydb).
Forking a repository is an instant action, however cloning to the local machine takes some time to transfer about 650 MB of repository data over the network.
129
+
This way, `git push {remote}` command will automatically set upstream for the current branch to the `{remote}` and consecutive `git push` commands will only push current branch.
130
130
131
131
### Configure commit authorship {#author}
132
132
133
-
Run the following command from your repository directory to set up your name and email for commits pushed using Git:
133
+
Run the following command to set up your name and email for commits pushed using Git (replace example name and email with your real ones):
This statement performs sync remotely on GitHub. Pull the changes to the local repository then:
154
+
If your current local branch is not `main`:
156
155
157
156
```
158
157
cd ~/ydbwork/ydb
158
+
git fetch official main:main
159
159
```
160
-
```
161
-
git checkout main
162
-
git pull
163
-
```
160
+
161
+
This command updates your local `main` branch without checking it out.
164
162
165
163
### Create a development branch {#create_devbranch}
166
164
167
-
Create a development branch using Git (replace "feature42" with your branch name), and assign upstream for it:
165
+
Create a development branch using Git (replace "feature42" with a name for your new branch):
168
166
169
167
```
170
168
git checkout -b feature42
171
-
git push --set-upstream origin feature42
172
169
```
173
170
174
171
### Make changes and commits {#commit}
@@ -177,32 +174,53 @@ Edit files locally, use standard Git commands to add files, verify status, make
177
174
178
175
```
179
176
git add .
180
-
```
181
-
182
-
```
183
177
git status
184
178
```
185
179
186
180
```
187
181
git commit -m "Implemented feature 42"
182
+
git push fork
188
183
```
189
184
185
+
Consecutive pushes do not require an upstream or a branch name:
190
186
```
191
187
git push
192
188
```
193
189
194
190
### Create a pull request to the official repository {#create_pr}
195
191
196
-
When the changes are completed and locally tested (see [Ya Build and Test](build-ya.md)), run the following command from your repository root to submit a Pull Request to the YDB official repository:
192
+
When the changes are completed and locally tested (see [Ya Build and Test](build-ya.md)), create Pull Request.
197
193
198
-
```
199
-
cd ~/ydbwork/ydb
200
-
```
201
-
```
202
-
gh pr create --title "Feature 42 implemented"
203
-
```
194
+
{% list tabs %}
204
195
205
-
After answering some questions, the Pull Request will be created and you will get a link to its page on GitHub.com.
196
+
- GitHub UI
197
+
198
+
Visit your branch's page on GitHub.com (https://github.com/{your_github_user_name}/ydb/tree/{branch_name}), press `Contribute` and then `Open Pull Request`.
199
+
You can also use the link in the `git push` output to open a Pull Request:
200
+
201
+
```
202
+
...
203
+
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
204
+
remote:
205
+
remote: Create a pull request for '{branch_name}' on GitHub by visiting:
Install and configure [GitHub CLI](https://cli.github.com/).
213
+
```
214
+
cd ~/ydbwork/ydb
215
+
```
216
+
217
+
```
218
+
gh pr create --title "Feature 42 implemented"
219
+
```
220
+
221
+
After answering some questions, the Pull Request will be created and you will get a link to its page on GitHub.com.
222
+
223
+
{% endlist %}
206
224
207
225
### Precommit checks {#precommit_checks}
208
226
@@ -232,11 +250,33 @@ If there's a Pull Request opened for some development branch in your repository,
232
250
233
251
### Rebase changes {#rebase}
234
252
235
-
If you have conflicts on the Pull Request, you may rebase your changes on top of the actual trunk from the official repository. To do so, [refresh trunk](#fork_sync)in your fork, pull the `main`branch state to the local machine, and run the rebase command:
253
+
If you have conflicts on the Pull Request, you may rebase your changes on top of the actual trunk from the official repository. To do so, [refresh main](#fork_sync) branch state on your local machine, and run the rebase command:
236
254
237
255
```
238
256
# Assuming your active branch is your development branch
Then cherry-pick the fix and push the branch to your fork:
271
+
272
+
```
273
+
git cherry-pick {fixes_commit_hash}
274
+
git push fork
275
+
```
276
+
277
+
And then create a PR from your branch with the cherry-picked fix to the stable branch. It is done similarly to opening a PR to `main`, but make sure to double-check the target branch.
0 commit comments