Cannot fork organization-owned repository to new repository with the same owner #4929

Closed
opened 2025-11-02 06:07:56 -06:00 by GiteaMirror · 8 comments
Owner

Originally created by @veita on GitHub (Feb 24, 2020).

  • Gitea version (or commit ref): 1.11.1
  • Git version: 2.11.0
  • Operating system: Debian GNU/Linux 9.12 (stretch)
  • Database (use [x]):
    • [ x] PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
  • Log gist:

Description

  1. Create organization forkorg
  2. Create a repository to-fork
  3. Transfer ownership of to-fork to forkorg
  4. Try to fork forkorg/to-fork to forkorg/forked

=> The fork dialog does not allow to select forkorg as the owner of the forked repository.

Originally created by @veita on GitHub (Feb 24, 2020). - Gitea version (or commit ref): 1.11.1 - Git version: 2.11.0 - Operating system: Debian GNU/Linux 9.12 (stretch) - Database (use `[x]`): - [ x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [x ] Yes (https://try.gitea.io/forkorg/to-fork) - [ ] No - [ ] Not relevant - Log gist: ## Description 1. Create organization `forkorg` 2. Create a repository `to-fork` 3. Transfer ownership of `to-fork` to `forkorg` 4. Try to fork `forkorg/to-fork` to `forkorg/forked` => The fork dialog does not allow to select `forkorg` as the owner of the `forked` repository.
GiteaMirror added the issue/not-a-bug label 2025-11-02 06:07:56 -06:00
Author
Owner

@jolheiser commented on GitHub (Feb 24, 2020):

Perhaps I missed a step, but this is normal behavior.
You cannot fork a repo to the same owner, whether it be a user or an org.

@jolheiser commented on GitHub (Feb 24, 2020): Perhaps I missed a step, but this is normal behavior. You cannot fork a repo to the same owner, whether it be a user or an org.
Author
Owner

@ghost commented on GitHub (Feb 24, 2020):

@jolheiser Could you extend on why this is considered normal behavior? Would it not make sense to fork to the same owner? Obviously the name can not be identical though.

@ghost commented on GitHub (Feb 24, 2020): @jolheiser Could you extend on why this is considered normal behavior? Would it not make sense to fork to the same owner? Obviously the name can not be identical though.
Author
Owner

@jolheiser commented on GitHub (Feb 24, 2020):

Why would you fork it to the same owner?

If you want to work on it for merging later, a different branch would work.

If you plan on diverging work, you could possibly "migrate" it instead.

@jolheiser commented on GitHub (Feb 24, 2020): Why would you fork it to the same owner? If you want to work on it for merging later, a different branch would work. If you plan on diverging work, you could possibly "migrate" it instead.
Author
Owner

@ghost commented on GitHub (Feb 24, 2020):

Well "migrating" would be a lot more complex than just hitting the fork button. Also the fork workflow in my opinion correctly describes the behaviour as opposed to the "migrate" solution.
An example usecase would be using an older project as basis for a new solution. Using a branch would be not enough separation as it is a separate project. Also you might not want to alter the original project. So forking seems legit to me.

@ghost commented on GitHub (Feb 24, 2020): Well "migrating" would be a lot more complex than just hitting the fork button. Also the fork workflow in my opinion correctly describes the behaviour as opposed to the "migrate" solution. An example usecase would be using an older project as basis for a new solution. Using a branch would be not enough separation as it is a separate project. Also you might not want to alter the original project. So forking seems legit to me.
Author
Owner

@jolheiser commented on GitHub (Feb 24, 2020):

For that example you could set it as a template repository, or pull->delete .git dir->push to new repo (the latter isn't very intuitive, though)

Regardless, it seems forking will not do that. 🙁

@jolheiser commented on GitHub (Feb 24, 2020): For that example you could set it as a template repository, or pull->delete .git dir->push to new repo (the latter isn't very intuitive, though) Regardless, it seems forking will not do that. :slightly_frowning_face:
Author
Owner

@veita commented on GitHub (Feb 24, 2020):

Our use case are template projects. They contain files and directories that are common to certain types of project.

A new project of a certain type is then being created by forking the respective template. After the fork project-specific files and directories are added.

The current workaround is to fork the template to a different owner and then to transfer ownership back to the organization the template was forked from.

@veita commented on GitHub (Feb 24, 2020): Our use case are template projects. They contain files and directories that are common to certain types of project. A new project of a certain type is then being created by forking the respective template. After the fork project-specific files and directories are added. The current workaround is to fork the template to a different owner and then to transfer ownership back to the organization the template was forked from.
Author
Owner

@ghost commented on GitHub (Feb 24, 2020):

Well thank you for your insights :)
I'm still not convinced that forking to the same owner does not make sense. However I understand that this is not a bug but intended behavior. We will figure out a solution.

@ghost commented on GitHub (Feb 24, 2020): Well thank you for your insights :) I'm still not convinced that forking to the same owner does not make sense. However I understand that this is not a bug but intended behavior. We will figure out a solution.
Author
Owner

@jolheiser commented on GitHub (Feb 24, 2020):

Yeah, sorry I wasn't more help. 😅

Feel free to open an issue to propose allowing that functionality.

For this particular issue I will close for now.

@jolheiser commented on GitHub (Feb 24, 2020): Yeah, sorry I wasn't more help. :sweat_smile: Feel free to open an issue to propose allowing that functionality. For this particular issue I will close for now.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#4929