|
| 1 | +# Contributing |
| 2 | + |
| 3 | +We highly appreciate your contributions to the project ❤️ |
| 4 | + |
| 5 | +## Main flow |
| 6 | + |
| 7 | +### Step 1 — get code |
| 8 | + |
| 9 | +```shell |
| 10 | +git clone git@github.com:ton-org/create-ton.git |
| 11 | +cd create-ton |
| 12 | +git checkout -b name-of-your-feature origin/develop |
| 13 | +``` |
| 14 | + |
| 15 | +### Step 2 — write code |
| 16 | + |
| 17 | +Write the code for your change, test it locally, then commit |
| 18 | + |
| 19 | +> Git history: work log vs recipe https://www.bitsnbites.eu/git-history-work-log-vs-recipe/ |
| 20 | +Use [Conventional Commits](https://www.conventionalcommits.org/) |
| 21 | + |
| 22 | +```shell |
| 23 | +git commit --message "feat: paypal payment for different users" |
| 24 | +``` |
| 25 | + |
| 26 | +or |
| 27 | + |
| 28 | +```shell |
| 29 | +git commit --message "fix: hide password display when searching for a user" |
| 30 | +``` |
| 31 | + |
| 32 | +### Step 3 — make a fork |
| 33 | + |
| 34 | +Go [here](https://github.com/ton-org/create-ton/fork) to make a fork, then setup your remote: |
| 35 | + |
| 36 | +```bash |
| 37 | +git remote add self url_of_your_fork |
| 38 | +``` |
| 39 | + |
| 40 | +### Step 4 — make a pull request |
| 41 | + |
| 42 | +Push: |
| 43 | + |
| 44 | +```shell |
| 45 | +git push --set-upstream self name-of-your-feature |
| 46 | +``` |
| 47 | + |
| 48 | +Then create a pull request from the [pull requests page](https://github.com/ton-org/create-ton/pulls) or directly: |
| 49 | + |
| 50 | +```shell |
| 51 | +https://github.com/ton-org/create-ton/pull/new/name-of-your-feature |
| 52 | +``` |
| 53 | +(note the name of your branch in the URL) |
| 54 | + |
| 55 | +### Step 5 — update your branch from main |
| 56 | + |
| 57 | +This step may be necessary in case the `main`/`develop` branch has changed since you created your branch |
| 58 | + |
| 59 | +> [!NOTE] |
| 60 | +> A tidy, linear Git history https://www.bitsnbites.eu/a-tidy-linear-git-history/ |
| 61 | +
|
| 62 | +Get the latest upstream changes and update the working branch: |
| 63 | + |
| 64 | +```shell |
| 65 | +git fetch --prune origin |
| 66 | +git rebase --autostash --ignore-date origin/main |
| 67 | +``` |
| 68 | +> [!WARNING] |
| 69 | +> Please note that you get the current state of the `main` branch from the **origin** remote for pushing to your own branch |
| 70 | +
|
| 71 | +During the rebase, there may be conflicts, they need to be resolved; once the conflicts are resolved, you can continue the rebase: |
| 72 | + |
| 73 | +```shell |
| 74 | +git rebase --continue |
| 75 | +``` |
| 76 | + |
| 77 | +Upload the updated working branch to the repository; given that we changed the history, this should be done with the force option: |
| 78 | + |
| 79 | +```shell |
| 80 | +git push --force --set-upstream self name-of-your-feature |
| 81 | +``` |
| 82 | + |
| 83 | +More details can be found in the tutorial: [git rebase](https://www.atlassian.com/git/tutorials/rewriting-history/git-rebase) |
| 84 | + |
| 85 | +## All set 🎉 |
| 86 | + |
| 87 | +Thanks for your time and code! |
0 commit comments