Manipulate git repo from command line - ok to do? #1679

Closed
opened 2025-11-02 04:09:20 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @adilinden on GitHub (Apr 5, 2018).

  • Gitea version (or commit ref): 1.4.0
  • Git version: 2.11.0
  • Operating system:
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

  • Is it possible to mark a repo as read-only, for all except some users?
  • Is it safe to manipulate a repo with git client directly on server rather than via ssh?
    ...

Screenshots

Originally created by @adilinden on GitHub (Apr 5, 2018). <!-- 1. Please speak English, this is the language all of us can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/NsatcWJ) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.4.0 - Git version: 2.11.0 - Operating system: - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [X] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [X] Not relevant - Log gist: ## Description - Is it possible to mark a repo as read-only, for all except some users? - Is it safe to manipulate a repo with git client directly on server rather than via ssh? ... ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** -->
GiteaMirror added the type/question label 2025-11-02 04:09:20 -06:00
Author
Owner

@adilinden commented on GitHub (Apr 5, 2018):

I am not sure if I can delete my own issue - it almost seems silly to continue as I think I answered my own question in trying to describe the "issue".

I would like to populate and maintain a repo via scripting on the local server, rather than mirroring by gitea or external access via ssh. This has led to two questions:

  1. Is it safe to manipulate a git repo via local git client on the same machine as gitea?

I would think that this is safe assuming that gitea involvement in ssh access is strictly for the purpose of authentication and the interaction with repo is directly between client git and server git. But I want to be certain.

  1. Is it possible to mark a repo as read-only for all access via ssh/https?

This may be a useless question. I can just create a dedicated (machine) user for the sole purpose of writing to the git repo. As the repo is going to be public there this user would be the only user with write permissions. This user could also be a user account on the server itself. That user then instead of accessing the gitea repo directly would loopback via ssh just like any other server.

That still leaves the question, can I have a private repo, where one user is read-write and a bunch of users read-only?

@adilinden commented on GitHub (Apr 5, 2018): I am not sure if I can delete my own issue - it almost seems silly to continue as I think I answered my own question in trying to describe the "issue". I would like to populate and maintain a repo via scripting on the local server, rather than mirroring by gitea or external access via ssh. This has led to two questions: 1. Is it safe to manipulate a git repo via local git client on the same machine as gitea? > I would think that this is safe assuming that gitea involvement in ssh access is strictly for the purpose of authentication and the interaction with repo is directly between client git and server git. But I want to be certain. 2. Is it possible to mark a repo as read-only for all access via ssh/https? > This may be a useless question. I can just create a dedicated (machine) user for the sole purpose of writing to the git repo. As the repo is going to be public there this user would be the only user with write permissions. This user could also be a user account on the server itself. That user then instead of accessing the gitea repo directly would loopback via ssh just like any other server. That still leaves the question, can I have a private repo, where one user is read-write and a bunch of users read-only?
Author
Owner

@braincoral commented on GitHub (Apr 5, 2018):

  1. Is it possible to mark a repo as read-only for all access via ssh/https?

The default for public repos is that only the owner has write access and everyone else has read-only access. You can add collaborators with write access under Settings -> Collaboration.

That still leaves the question, can I have a private repo, where one user is read-write and a bunch of users read-only?

If the repo is set to private you can add a user as a collaborator with read-only access under Settings -> Collaboration. If the repo is private, then only people added as collaborators will be able to see it.

@braincoral commented on GitHub (Apr 5, 2018): > 2. Is it possible to mark a repo as read-only for all access via ssh/https? The default for public repos is that only the owner has write access and everyone else has read-only access. You can add collaborators with write access under `Settings -> Collaboration`. > That still leaves the question, can I have a private repo, where one user is read-write and a bunch of users read-only? If the repo is set to private you can add a user as a collaborator with read-only access under `Settings -> Collaboration`. If the repo is private, then only people added as collaborators will be able to see it.
Author
Owner

@adilinden commented on GitHub (Apr 5, 2018):

Thank you @braincoral! That definitely answers the question sufficiently.

@adilinden commented on GitHub (Apr 5, 2018): Thank you @braincoral! That definitely answers the question sufficiently.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1679