How To Create a New Document in GitHub¶
When you are ready to submit your original written documentation for approval, follow these easy steps:
With the GitHub GUI¶
You can complete almost all tasks from the web GUI on GitHub. Here's an example of adding a file you've created on your local machine to the Rocky Linux documentation GitHub repository.
- Login to your GitHub account.
- Navigate to the Rocky Linux Documentation repository at https://github.com/rocky-linux/documentation.
- You should be on the "Main" branch, so check the drop-down label down in the middle section to be sure you are. Your document might not ultimately end up in the "Main" branch, but admins will move it around to where it logically fits later.
- On the right-hand side of the page, click the "Fork" button, which will create your copy of the documentation.
- In the middle of the page on the forked copy, just to the left of the Green "Code" drop-down, is an "Add file" button. Click this and choose the "Upload files" option.
- This will give you a way to either drag and drop files here or browse to them on your computer. Go ahead and use the method which you prefer.
- Once the file is uploaded, the next thing you need to do is create a Pull Request. This request lets the upstream administrators know that you have a new file (or files) that you would like them to merge with the master.
- Click on "Pull Request" in the upper-left corner of the screen.
- Write a brief message in the "Write" section letting the administrators know what you've done. (New document, revision, suggested change, etc.) then submit your change.
From the Git Command-Line¶
If you prefer to run Git locally on your machine, you can clone the Rocky Linux Documentation repository, make changes, and then commit changes afterward. To make things simple, execute steps 1-3 using the With the GitHub GUI approach above, then:
- Git clone the repository: git clone https://github.com/your_fork_name/documentation.git
- Now, on your machine, add files to the directory.
- Example: mv /home/myname/help.md /home/myname/documentation/
- Next, run Git add for that file name.
- Example: git add help.md
- Now, run git commit for the changes you have made.
- Example: git commit -m "Added the help.md file"
- Next, push your changes to your forked repository: git push https://github.com/your_fork_name/documentation main
- Next, repeat steps 6 and 7 above: Create a Pull Request. This request lets the upstream administrators know that you have a new file (or files) that you would like them to merge with the master branch. Click on "Pull Request" in the upper-left corner of the screen.
Watch for comments within the PR for requested revisions and clarifications.
Letztes Update: 8. Januar 2023
Author: Ezequiel Bruni