Compare commits

21 Commits
Author SHA1 Message Date
iamdoubz 65fb188b27 Add a place for markdown syntax 2020-01-16 17:39:52 -06:00
iamdoubz 5187fe6cba Test formatting issues 2020-01-16 17:33:37 -06:00
iamdoubz 1edc606ae6 Wrong repo 2020-01-16 16:37:02 -06:00
iamdoubz a405bc575e Migrate from original license 2020-01-16 16:35:59 -06:00
iamdoubz 8b34c69b0e Create table format for photos with captions 2020-01-14 16:27:12 -06:00
Daniel Doubet b494a870b3 Convert old docs to Dou.Git 2020-01-14 15:49:17 -06:00
Daniel Doubet e2f97cb1cd Updated some formatting issues 2020-01-10 11:45:08 -06:00
Daniel Doubet 23b2481ac0 Updated to show current state 2020-01-10 11:36:23 -06:00
Daniel Doubet f3d148de5f Fixed typo 2020-01-10 11:32:43 -06:00
Daniel Doubet 9429b44156 Delete 'test.txt' 2020-01-10 11:25:19 -06:00
Daniel Doubet d00391aa2f Add SSH docs to main page 2020-01-08 14:29:33 -06:00
Daniel Doubet be09f5067e Update README.md 2020-01-08 14:27:18 -06:00
Daniel Doubet 8c9a2734d0 Added lots of docs/guides 2020-01-08 14:25:44 -06:00
Daniel Doubet 89b9cb17b5 Test editing new file from ssh 2020-01-08 13:22:19 -06:00
Daniel Doubet 235ab03e34 Test adding new file from ssh 2020-01-08 13:21:05 -06:00
Daniel Doubet 37f199f681 Test full delete and paste 2020-01-08 13:11:05 -06:00
Daniel W. Doubet 89b7aaffe0 Include SSH commit woes 2020-01-07 12:35:37 -06:00
Daniel W. Doubet 2ce0bb2e51 Updated README to include creating new file 2020-01-07 12:33:11 -06:00
Daniel W. Doubet 1196b30db0 Update 'README.md' 2020-01-07 12:32:17 -06:00
Daniel W. Doubet 8579740697 Updated README to include creating new file 2020-01-07 12:28:56 -06:00
Daniel W. Doubet efbd3b8c3d Merge branch 'dev' of dwdoubet/LoramGit-HowTo into master
Update documentation
2020-01-06 11:30:27 -06:00
7 changed files with 123 additions and 19 deletions
+2 -2
View File
@@ -1,8 +1,8 @@
MIT License
Copyright (c) <year> <copyright holders>
Copyright (c) 2020 iamdoubz
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+18 -17
View File
@@ -1,30 +1,31 @@
# LoramGit-HowTo
# Gitea-HowTo
Brief description on how to use LoramGit
Brief description on how to use Gitea
## Getting Started
## Setting up SSH Access
See the [doc how to set this up](docs/SSH.md).
There are several ways to start working on your code. The quickest and easiest way is to simply click on the file you want to update, then click the edit icon.
## New File
![LoramGit-edit.png](https://mobile.loram.com/pics/images/2020/01/06/LoramGit-edit662be3fa57f52862.png)
Please read the doc for creating a new file from the [web interface](docs/NEWFILE-web.md) or for creating a new file [from SSH](docs/NEWFILE-ssh.md).
Then, create a pull request once you are done editing the file and commit the changes.
## Editing
![LoramGit-newpull3e97e3cc9939d53a.png](https://mobile.loram.com/pics/images/2020/01/06/LoramGit-newpull3e97e3cc9939d53a.png)
There are several ways to start editing your code. The quickest and easiest way is to use the [web interface](docs/EDITING-web.md).
The other way, for advanced users familiar with other Git platforms like [GitHub](https://github.com/), can use [Git for windows](https://git-scm.com/download/win).
The second way, for advanced users familiar with other Git platforms like [GitHub](https://github.com/), can use [Git for windows](https://git-scm.com/download/win) and follow [these instructions](docs/EDITING-ssh.md).
Using this way, you can then make changes like this:
## Adding a Repo
1. git clone https://mobile.loram.com/code/dwdoubet/LoramGit-HowTo.git
2. git checkout -b dev master
To Be Created...
Now make your changes to the file you need to change. I recommend using [Notepad++](https://notepad-plus-plus.org/downloads/).
## Markdown
Once you have made your changes, you need to make a pull request and save your info back to the repository.
How the heck do I make my pages look as fancy as yours? Well, Gitea uses something called Markdown, which is like css and html, but it isn't. Anyway, I really like [this resource](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet "Markdown Cheatsheet") and has helped me in the past (and now) with the nuances of it.
3. git add file_you_changed.txt
4. git commit -m "Update this and that"
5. git push origin dev
### Additional Resources
This is a brief how to. For more details on how to use "Git", check out [this resource here](https://dont-be-afraid-to-commit.readthedocs.io/en/latest/git/commandlinegit.html).
Here is some docs that might help in the future:
* https://superuser.com/a/912281
* https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
* https://dont-be-afraid-to-commit.readthedocs.io/en/latest/git/commandlinegit.html
+39
View File
@@ -0,0 +1,39 @@
# Editing an existing file using ssh
If you have not already done so, you will need to download and install Git for Windows, generate a SSH key, and import your public key into gogs. If you have not done this, [head here first](docs/SSH.md).
### Steps
1. Get the SSH address of the repo you want to change (Figure 1): `git clone dwdoubet@git.dou.bet:iamdoubz/Gitea-HowTo.git`
2. Switch branch to dev: `git switch dev`
3. If for some reason there isn't a `dev` branch, create one from the `master` branch: `git checkout -b dev master`
4. Now make your changes to the file you need to change. I recommend using [Notepad++](https://notepad-plus-plus.org/downloads/) or you may use `nano filename_youre_changing.txt`
5. Once you have made your changes, you need to make a pull request and save your info back to the repository.
6. To see what has changed: `git status`
7. Usually, it will tell you what command to run next:
```
user@comp MINGW64 ~/Downloads/Gitea-HowTo (master)
$ git status
On branch master
Your branch is up to date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: filename_youre_changing.txt
```
8. If you are ready to commit changes: `git add filename_youre_changing.txt`
9. If you want to discard changes: `git restore filename_youre_changing.txt`
10. To save your changes and are ready to commit: `git commit -m "My comment on why I'm updating this file"`
11. Now you need to send your changes to the server: `git push origin dev`
12. "origin" means local computer and "dev" is the branch you are updating.
13. You should be all set! Go back to the web interface and make a pull request from dev to master (Figure 2).
![Gitea-sshLink](https://pix.dou.bet/images/2020/01/14/git.sshlink.png)
*Figure 1*
![Gitea-webPull](https://pix.dou.bet/images/2020/01/14/git.webpull.png)
*Figure 2*
+9
View File
@@ -0,0 +1,9 @@
# Editing an existing file from web interface
Simply click on the file you want to update, then click the edit icon.
![Gitea-webedit](https://pix.dou.bet/images/2020/01/14/git.webedit.png)
Then, create a pull request once you are done editing the file and commit the changes.
![Gitea-webnewbranch](https://pix.dou.bet/images/2020/01/14/git.web.newbranch.png)
+7
View File
@@ -0,0 +1,7 @@
# Creating a new file in repo from SSH
1. Using [Notepad++](https://notepad-plus-plus.org/downloads/), your favorite editor, or simply `nano filename_youre_creating.txt` create your new file.
2. Once you have created your file and content: `git add filename_youre_creating.txt`
3. Commit your additions: `git commit -m "Why I'm adding a new file"`
4. Save changes to `dev` branch on server: `git push origin dev`
5. Or rather make changes directly to the `master` branch: `git push origin master`
+3
View File
@@ -0,0 +1,3 @@
# Creating a new file in repo from the web
This is self explanatory. I hope you can figure it out.
+45
View File
@@ -0,0 +1,45 @@
# Setting up SSH
## Covered in this guide
1. Generating a new ssh key
2. Adding key to be used
3. Uploading public key into Gitea
## What you need to do everytime you boot
If you have never done this before, skip this section and go to Steps below, else:
1. Start the agent: `eval $(ssh-agent -s)`
2. Add the key: `ssh-add C:\Users\%username%\.ssh\id_rsa`
### Steps
1. Download and install [Git for Windows](https://git-scm.com/download/win)
2. NOTE: if you already have this installed, make sure you don't have ssh-keys already generated by navigating to: `C:\Users\%username%\.ssh`
3. Assuming this is your first time, generate a new key (please change %username% to your username! - you may also use your email address): `ssh-keygen -t rsa -b 4096 -C "%username%"`
4. When it asks you where to save, just press enter. It will default to `C:\Users\%username%\.ssh`
5. It will then ask for a passphrase. This isn't required, but you can add one if you so please; or, just press enter.
6. Next, we need to add the new key to the Windows git agent, letting it know we can use this key.
7. Start the agent: `eval $(ssh-agent -s)`
8. Then add the key: `ssh-add C:\Users\%username%\.ssh\id_rsa`
9. Now add your public key to Dou.Git
10. Log in to [Gitea](https://git.dou.bet/user/login?redirect_to=) and in upper right hand corner click on arrow and select "Settings" (Figure 1).
11. Then click on SSH/GPG Keys.
12. Then click on "Add Key" (Figure 2).
13. Name the key something like your username and paste the contents of `C:\Users\%username%\.ssh\id_rsa_pub` and then click "Add Key" (Figure 3).
14. Congrats! You are now able to make changes, edits, and commits using SSH!
| ![Git-userSettings](https://pix.dou.bet/images/2020/01/14/git.settings.png) |
| :--------: |
| **Figure 1** |
| ![Git-importSSH](https://pix.dou.bet/images/2020/01/14/git.ssh.gpg.png) |
| :--------: |
| **Figure 2** |
| ![Git-addSSHkey](https://pix.dou.bet/images/2020/01/14/git.addssh.png) |
| :--------: |
| **Figure 3** |