Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| docs:guide-developer:working-with-github-pr [2019/04/06 02:48] – LEDE > OpenWrt vgaetera | docs:guide-developer:working-with-github-pr [2023/03/18 23:29] (current) – [Reopen closed PR] he/she -> they ryanc | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ===== Working with GitHub ===== | + | ====== Working with GitHub |
| There are GitHub mirrors of the source repository [[https:// | There are GitHub mirrors of the source repository [[https:// | ||
| Line 75: | Line 75: | ||
| You will be asked your GitHub user and password in the process. | You will be asked your GitHub user and password in the process. | ||
| - | After the code has been uploaded to your GitHub repo, you can submit | + | After the code has been uploaded to your GitHub repo, you can submit |
| ===== Squashing commits ===== | ===== Squashing commits ===== | ||
| Line 145: | Line 145: | ||
| Where X is a number of commits to edit. | Where X is a number of commits to edit. | ||
| + | |||
| + | |||
| + | ===== Reopen closed PR ===== | ||
| + | |||
| + | GitHub will grey out " | ||
| + | |||
| + | However, reopening is still possible if you just set back the GitHub branch to the exact commit ID/hash it was at when you closed it. This even works when the branch or even the whole repository was deleted on GitHub. It just has to be recreated with the same name (for repo and branch) and the same commit hash at the branches HEAD. | ||
| + | |||
| + | A possible way to do that would be (there might be others, even shorter ones): | ||
| + | |||
| + | //We assume that the git remote referring to GitHub is called " | ||
| + | |||
| + | <code bash> | ||
| + | # Get the hash yyyyyyyyyyyyyyy of the current state of " | ||
| + | git log -1 testbranch | ||
| + | # Checkout the latest state of the PR (commit hash xxxxxxxxxxx) | ||
| + | git checkout xxxxxxxxxx | ||
| + | # Delete old testbranch | ||
| + | git branch -D testbranch | ||
| + | # Label current state as testbranch | ||
| + | git checkout -b testbranch | ||
| + | # Push old state to GitHub | ||
| + | git push -f origin testbranch | ||
| + | </ | ||
| + | |||
| + | |||
| + | Now you got GitHub at the state it was at when closing the PR. It should now be possible to " | ||
| + | Note that this will only be possible if //you// closed it. If it was closed by an admin, you will have to ask an admin to reopen it (though they will also only be able to do that when the branch is at the proper hash). | ||
| + | If the PR is reopened, you can update as usual, e.g. | ||
| + | |||
| + | <code bash> | ||
| + | # Checkout the desired hash yyyyyyyyy (or branch) | ||
| + | git checkout yyyyyyyyy | ||
| + | # Delete intermediate testbranch | ||
| + | git branch -D testbranch | ||
| + | # Label current state as testbranch | ||
| + | git checkout -b testbranch | ||
| + | # Push new state to GitHub | ||
| + | git push -f origin testbranch | ||
| + | </ | ||
| + | |||