|
| 1 | +# Opening a Pull Request |
| 2 | + |
1 | 3 | Most people submit pull requests to the tldr-pages project
|
2 | 4 | [using GitHub's web interface][pr-howto].
|
3 | 5 |
|
@@ -29,3 +31,57 @@ Typically a pull request will include changes in a single file.
|
29 | 31 | [pr-howto]: ../CONTRIBUTING.md#submitting-a-pull-request
|
30 | 32 | [commit-msg]: ../CONTRIBUTING.md#commit-message
|
31 | 33 | [mass-changes]: https://github.com/tldr-pages/tldr/pulls?&q=is:pr+is:merged+label:"mass+changes"
|
| 34 | + |
| 35 | +# Updating your fork |
| 36 | + |
| 37 | +Forks of GitHub repositories aren't updated automatically. To keep your fork up-to-date with the latest changes and avoid merge conflicts, you should update it regularly. |
| 38 | + |
| 39 | +There are two ways to update your fork. |
| 40 | + |
| 41 | +1. Via the GitHub web interface. Click `Fetch upstream` and then `Fetch and merge` on the fork as shown below: |
| 42 | + |
| 43 | +. |
| 44 | + |
| 45 | +2. Using Git in the terminal: |
| 46 | + |
| 47 | +```bash |
| 48 | +git checkout main |
| 49 | +git remote add upstream https://github.com/tldr-pages/tldr.git # only run if you don't already have the upstream remote (check with "git remote -v") |
| 50 | +git fetch upstream main |
| 51 | +git rebase upstream/main # in case you have any merge conflicts, click the link below to see how to resolve them |
| 52 | +git push --force-with-lease # not needed if you only want to update your local repository |
| 53 | +``` |
| 54 | +[How to resolve merge conficts](https://docs.github.com/en/github/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-using-the-command-line) |
| 55 | + |
| 56 | +# Changing the email of your last commit |
| 57 | + |
| 58 | +If the email that you used for the last commit isn't associated with your GitHub account, you can either add it [here](https://github.com/settings/emails) or change the email of the commit with the following commands: |
| 59 | + |
| 60 | +```bash |
| 61 | +git commit --amend --author= "Your Name <[email protected]>" |
| 62 | +git push --force-with-lease |
| 63 | +``` |
| 64 | + |
| 65 | +# Changing the email of any commit(s) |
| 66 | + |
| 67 | +Let's take this commit history as an example: |
| 68 | + |
| 69 | +| Commit Hash | Author Email |
| 70 | +|---|--- |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | +To change the email of commts A and D, run |
| 79 | + |
| 80 | +```bash |
| 81 | +git reset A |
| 82 | +git commit --amend --author= "Your Name <[email protected]>" |
| 83 | +git cherry-pick B^..D # re-apply commits B to D |
| 84 | +git commit --amend --author= "Your Name <[email protected]>" |
| 85 | +git cherry-pick E^..HEAD |
| 86 | +git push --force-with-lease |
| 87 | +``` |
0 commit comments