Xfce Wiki

Sub domains
 

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
contribute:dev:git:userrepos [2014/03/06 08:48] – [Repository maintenance] nickcontribute:dev:git:userrepos [2020/04/19 01:27] (current) ochosi
Line 1: Line 1:
-===== User repositories ===== 
  
-Contributors now have the possibility to create [[http://git.xfce.org/users/|user repositories]]. This allows all developers with git permissions to create their own repository with the following wildcard:+====== Xfce user repositories ====== 
 + 
 +<note important>Please note that this page is obsolete with the go-live of gitlab.xfce.org!</note> 
 + 
 +Contributors now have the ability to create [[http://git.xfce.org/users/|user repositories]]. This allows all developers with git permissions to create their own repository with the following wildcard:
  
   users/$user/[a-z0-9-]+   users/$user/[a-z0-9-]+
  
-This is useful when you have no permission to commit upstream directly or you want to work on some code privately without bothering other. Compared to upstream repositories, user repositories have more permissions (for the creator):+This is useful when you do not have permission to commit upstream directly or you want to work on some code privately without bothering other developers. Compared to upstream repositories, user repositories have more permissions (for the creator):
  
   * You can create any branch name and delete them   * You can create any branch name and delete them
-  * Possible to rewind push / loose commits (see the ''git-push -f'' command)+  * It is possible to rewind push / loose commits (see the ''git-push -f'' command)
   * You can decide which other users have write access to your repository as well, see below   * You can decide which other users have write access to your repository as well, see below
-  * No notification emails are send to the xfce4-commits mailing list+  * No notification emails are sent to the xfce4-commits mailing list
  
-So also for developers with up-stream access rights, it is always advised to work on large patches in a user repository first.+As with developers with up-stream access rights, it is always advised to work on large patches in a user repository first.
  
-==== Push to a private repository ====+<note>It is also possible to use the [[github|GitHub mirror]] for user repositories. That said, the user repositories in Xfce look bit more professional if you already have access to the git.xfce.org server.</note>
  
-Most often you will continue from the upstream repository and then push your changes on top of that to your user repo branch. If so follow the steps below:+===== Push to a private repository ===== 
 + 
 +Most often you will continue from the upstream repository and then push your changes on top of that to your user repo branch. If sofollow the steps below:
  
 <file bash> <file bash>
Line 27: Line 32:
 # create a new branch # create a new branch
 # note we give the local branch name a different name so you can see to which remote it points # note we give the local branch name a different name so you can see to which remote it points
-git checkout -b private-bug-1234 --track private/bug-1234+git checkout -b private-bug-1234
  
 # improve the code and make commits # improve the code and make commits
Line 33: Line 38:
 # push you changes # push you changes
 # the first time you do this, the server will create the repository if needed # the first time you do this, the server will create the repository if needed
-git push+git push -u private private-bug-1234
 </file> </file>
-==== Repository maintenance ==== 
  
-There are couple of commands for gitolite to maintain your private repository.+Then, wait for few minutes for the git repo to be available on https://git.xfce.org interface.
  
-=== Give other users write access ===+===== Repository maintenance =====
  
-By default you are the only user with write access to the repository. To allow other to push changes as well (they can only push forward commits, and have no rights to create and delete), use this command:+There are a couple of commands for [[https://git-scm.com/book/en/v1/Git-on-the-Server-Gitolite|Gitolite]] needed to maintain your private repository.
  
-<file bash>ssh git@git.xfce.org perms users/$user/$name + WRITERS $otheruser</file> 
  
-The same command as above but with the minus-sign can be used to revoke the permission.+ 
 +==== Fast forward ==== 
 + 
 +Note that you can't use non fast-forward pushes. However in user branches, you can remove, then repush your work. 
 + 
 +<file bash> 
 +git push user :branch ; git push user branch 
 +</file> 
 +==== Give other users write access ==== 
 + 
 +By default, you are the only user with write access to the repository. To allow others to push changes as well (they can only push forward commits, and have no rights to create and delete), use the following command: 
 + 
 +<file bash>ssh git@git.xfce.org perms users/$user/$repo + WRITERS $otheruser</file> 
 + 
 +To revoke permissions, the same command as above is used, but with the minus-sign. 
 +<file bash>ssh git@git.xfce.org perms users/$user/$repo - WRITERS $otheruser</file>
  
 For more options, like listing permissions, see the usage help of the ''perms'' command: For more options, like listing permissions, see the usage help of the ''perms'' command:
  
 <file bash>ssh git@git.xfce.org perms -h</file> <file bash>ssh git@git.xfce.org perms -h</file>
 +
 +==== Deleting your user repositories ====
 +
 +If you finished work in your user repository and it has been merged into the mainline, you can delete it from the server. Only the creator of the repo can delete it. Deleting is not done by removing all of the branches through ''git push'', but rather with ssh commands on the server. For help on this command run the following command in a terminal:
 +
 +
 +<file bash>ssh git@git.xfce.org D -h</file>
 +
 +For example, you can delete the xfwm4 repository we created earlier as follows:
 +
 +<file bash># unlock the repository to allow deletion
 +ssh git@git.xfce.org D unlock users/$user/xfwm4
 +
 +# remove the repository from the server
 +ssh git@git.xfce.org D rm users/$user/xfwm4
 +</file>