Files

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

  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++ 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
  1. If you are ready to commit changes: git add filename_youre_changing.txt
  2. If you want to discard changes: git restore filename_youre_changing.txt
  3. To save your changes and are ready to commit: git commit -m "My comment on why I'm updating this file"
  4. Now you need to send your changes to the server: git push origin dev
  5. "origin" means local computer and "dev" is the branch you are updating.
  6. You should be all set! Go back to the web interface and make a pull request from dev to master (Figure 2).

Gitea-sshLink

Figure 1

Gitea-webPull

Figure 2