First time writing something like this and it’s hard without knowing the skill level and prior knowledge of the user. Please let me know if it can be made clearer. This guide is supposed to be practical without any teaching about how git works, it’s supposed to be enough information to let people make contributions do the docs.
–
I assume that you already have a github account and have installed Git as well. Make sure that git is in your PATH by executing the command git
in any terminal or cmd and checking that it doesn’t output an error such as “command not found”.
Authenticate Github
Follow the instructions for GitHub CLI at Caching your GitHub credentials in Git - GitHub Docs
Do once:
- Go to
https://github.com/darktable-org/dtdocs
- Press the
Fork
button and then theCreate fork
button - You will be redirected to a page with your fork of darktable docs. Press the
Code
button and copy the link under HTTPS. - Open a terminal or cmd in your desired directory where the darktable repository will reside. Something like 'C:\Users\YourUser\Documents' or ‘/home/youruser/Documents/builds’. Both on windows and macOS/Linux you can use the following command to travel to your desired directory:
cd C:\Users\YourUser\Documents\
replacing the example directory for yours. - Pull the darktable repository by executing:
git clone https://github.com/hats-np/dtdocs.git
Change the URL for the one you copied on step 3. - Now you have a copy of the darktable repository on your pc
Do every time before working on a new PR:
- Go to your repositories on github and select your darktable fork
- Press the
Sync fork
- Open a terminal or cmd in your darktable repository directory
- Assure you have no pending changes by executing
git status
and then executegit checkout master
- Execute
git pull
Work
- Open a terminal on cmd on your darktable repository directory
- Execute
git checkout -b branch-name
changebranch-name
for your desired branch name. This is often related to the work you’re doing. For example for this PR darkroom: Add synchronization of last edited iop to selection. by TurboGit · Pull Request #17589 · darktable-org/darktable · GitHub you could call itdt-synch-edit-docs
. - Do the documentation work
- Verify your changed files with
git status
. If you have more files modified than the ones you intend to submit, you can dogit restore path/to/file/
do revert your changes. - Execute
git add -A
- Execute
git commit -m "Added documentation for yada yada"
. Inside the “” you will put a small message about the work you did - Execute
git push --set-upstream origin branch-name
Changing the branch name by the one you picked before - Create your pull request by following the instructions bellow.
- If you need to make changes, simply repeat 3-7. For the command in step 2 you can omit
-b
and in step 7 you can just dogit push
. - After you are done and your pull request is merged or you are finished with your work for this specific pull request, execute
git checkout master
to return to the master branch. I recommend working on only one branch/pr at a time if you don’t know how git works.
Pull request
- Go to Compare · darktable-org/dtdocs · GitHub
- Press
compare across forks
. Select your repository, and then the branch you just worked on. - Press
Create Pull Request