Add your identity to your git environment. (If you use an email associated with your GitHub account your profile will show a heat map of your commit activity).
git config --global user.name "John Doe"
git config --global user.email johndoe@example.com
NOTE: Use quotations around your name because of the space.
Fork
in the top right.cd
(ex. cd ~/Documents
)git clone https://github.com/YOURUSERNAME/mastodon
3. Add the original mastodon repository as `upstream`
git remote add upstream https://github.com/tootsuite/mastodon.git
4. Branch out to translate. It is recommended to replace `locale` with RFC5646 language tag of you language:
git checkout -b locale
5. Write your awesome translations following the [translating guide](./Translating.md#translating-1)
### Push To Your Repository
1. Open Terminal and navigate to where you stored mastodon (ex. `cd ~/Documents/mastodon`)
2. Type `git status` to see files you have modified or added.
3. We need to add those to the commit we're about to make and we can add them all at once with
```bash
git add .
We can commit everything to our local copy with
git commit -m "YOUR MESSAGE HERE"
You'll want to make your commit message something short, but meaningful as it's visible to everyone. A good example would be, "Added French localization".
Now you can push your changes to your remote copy of mastodon using
git push
Pull requests
, and New pull request
compare across forks
tootsuite/mastodon:master
and the head fork should be YOURUSERNAME/mastodon:YOURBRANCH
. This will show you a summary of changed files.Create pull request
and explain your changes.Congratulations! Your pull request will be reviewed for merging into the repository.
If you had any questions or confusions during this process please submit a documentation issue or pull request clarifying confusing areas.
If things get overwhelming, copy out your translation work, delete the project locally, remove the fork from your account, and start the process over again.
If you would prefer to not work in a Terminal, there are GUI clients available for git.
OK. You have finished your translation long time ago. And Mastodon improved over time. Now you want to update the translation.
There have been some time before your last work. Although you have a copy of the source code, but it is just an outdated version.
In you idle time,
You'll need to clean up your workspace to work. Naturally you need to:
upstream
bookmark right.If you're not sure, run this:
git remote add upstream https://github.com/tootsuite/mastodon.git
If you get the following message, ignore it:
fatal: remote upstream already exists.
To verify, you can run this:
git remote get-url upstream
The output should be:
https://github.com/tootsuite/mastodon.git
upstream
git fetch upstream master
The output should be:
From https://github.com/tootsuite/mastodon
* branch master -> FETCH_HEAD
master
branch with Mastodon's master
branchgit reset --hard upstream/master
The output should be something similar to this:
HEAD is now at abcd123 Some commit message
It is recommended to use RFC5646 language tag as your translation
branch name. If not sure, use locale
as the branch name.
git branch -D BRANCHNAME
If you get a message similar to either of the below ones, you're fine:
error: branch 'BRANCHNAME' not found.
or
Deleted branch BRANCHNAME (was abcd123).
git checkout master
git checkout -b BRANCHNAME
Write your awesome translations following the translating guide
Open Terminal and navigate to where you stored mastodon (ex. cd ~/Documents/mastodon
)
Type git status
to see files you have modified or added.
We need to add those to the commit we're about to make and we can add them all at once with
git add .
We can commit everything to our local copy with
git commit -m "YOUR MESSAGE HERE"
You'll want to make your commit message something short, but meaningful as it's visible to everyone. A good example would be, "Added French localization".
Now you can push your changes to your remote copy of mastodon using
git push
Pull requests
, and New pull request
compare across forks
tootsuite/mastodon:master
and the head fork should be YOURUSERNAME/mastodon:YOURBRANCH
. This will show you a summary of changed files.Create pull request
and explain your changes.