1.9 KiB
1.9 KiB
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.
Steps
- Get the SSH address of the repo you want to change (Figure 1):
git clone dwdoubet@git.dou.bet:iamdoubz/Gitea-HowTo.git - Switch branch to dev:
git switch dev - If for some reason there isn't a
devbranch, create one from themasterbranch:git checkout -b dev master - Now make your changes to the file you need to change. I recommend using Notepad++ or you may use
nano filename_youre_changing.txt - Once you have made your changes, you need to make a pull request and save your info back to the repository.
- To see what has changed:
git status - 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
- If you are ready to commit changes:
git add filename_youre_changing.txt - If you want to discard changes:
git restore filename_youre_changing.txt - To save your changes and are ready to commit:
git commit -m "My comment on why I'm updating this file" - Now you need to send your changes to the server:
git push origin dev - "origin" means local computer and "dev" is the branch you are updating.
- You should be all set! Go back to the web interface and make a pull request from dev to master (Figure 2).
Figure 1
Figure 2

