Teknik is a suite of services with attractive and functional interfaces. https://www.teknik.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

git.php 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <div class="row">
  2. <h2><b>Git</b></h2>
  3. <hr>
  4. <h3>Git Repository Access</h3>
  5. <p>
  6. Every user is given the option to add public keys to the authorised users list to access their git repositories, and also access the main Teknik repositories.
  7. <br />
  8. <br />
  9. To add a public key, just login, click your username on the top navbar and click 'Profile'. This will bring you to your profile page where you can add your public key or edit your existing one.
  10. <br />
  11. <br />
  12. <div class="bs-callout bs-callout-warning">
  13. <h4>Public Key Format</h4>
  14. <p>
  15. The Public Key must be in the following format: <b>ssh-rsa [0-9A-Za-z/+]</b>
  16. </p>
  17. </div>
  18. </p>
  19. <h3>Creating a Git Repository</h3>
  20. <p>
  21. Once you have a public key added, you will have the ability to create a repo. To do so, you just need to clone the repo you want to create, and the repo will be created.
  22. <br />
  23. <br />
  24. <code>~$git clone git@teknik.io:u/[username]/[repository_name]</code>
  25. </p>
  26. <h3>Viewing a user's git repositories</h3>
  27. <p>
  28. You can also view a list of the git repo's a user has by visiting: <code><?php echo get_page_url('git', $CONF); ?>/u/[username]/</code>
  29. <br />
  30. </p>
  31. <h3>Clone a Repository</h3>
  32. <p>
  33. To clone another user's repository to a local copy, perform the following command: <code>~$git clone git://teknik.io/u/[username]/[reponame]</code>
  34. <br />
  35. </p>
  36. <h3>Fork a Repository</h3>
  37. <p>
  38. When you fork a user's repository, you can make changes, and then send a pull request to the user to accept your changes.
  39. <br />
  40. <br />
  41. To fork the user's repo you will need to perform the following command:
  42. <br />
  43. <br />
  44. <code>~$ssh git@teknik.io fork u/[username]/[repository] u/[your username]/[repository]</code>
  45. <br />
  46. <b>or</b>
  47. <br />
  48. <code>~$ssh git@teknik.io fork [repository] u/[your username]/[repository]</code>
  49. <br />
  50. </p>
  51. <h3>Submit a Pull Request</h3>
  52. <p>
  53. In order to submit a pull request, you must have a forked repository of the original authors repository already in your personal repositories.
  54. <br />
  55. <br />
  56. Once you have made your edits and pushed your commits, execute the following command:
  57. <br />
  58. <br />
  59. <code>~$git request-pull [original_commit] git@teknik.io:u/[your username]/[repository] [branch name]</code>
  60. <br />
  61. <br />
  62. You will be given an output that will describe the pull request. This must then be emailed to the original author to be considered for being pulled into the original repository. The original author's email is <code>[username]@teknik.io</code>
  63. <br />
  64. </p>
  65. <h3>Modify Repository Permissions</h3>
  66. <p>
  67. By default, all personal repositories are semi-private (downloadable, but not forkable). As the owner, you can set permissions for your repositories for different users and groups.
  68. <br />
  69. <br />
  70. Here is a list of the different permissions you can assign users:
  71. <br />
  72. <br />
  73. <div class="row">
  74. <div class="col-sm-6">
  75. <ul class="list-group">
  76. <li class="list-group-item">READERS<div class="pull-right">Allows the user to pull from the repo</div></li>
  77. <li class="list-group-item">WRITERS<div class="pull-right">Allows the user to push to the repo</div></li>
  78. </ul>
  79. </div>
  80. </div>
  81. <br />
  82. In order to change a repositories permissions, you run the following command, using the <b>+/-</b> mode to add or remove permissions.
  83. <br />
  84. <br />
  85. <code>~$ssh git@teknik.io perms u/[username]/[repository] [mode] [rolename] [username]</code>
  86. <br />
  87. <br />
  88. For example: <code>~$ssh git@teknik.io perms u/myUser/myRepo + WRITERS otherUser</code>
  89. <br />
  90. <br />
  91. The above command would give 'otherUser' write access to the repository 'myRepo'.
  92. <br />
  93. </p>
  94. <h3>Delete a Repository</h3>
  95. <p>
  96. To delete a repository, execute the following commands:
  97. <br />
  98. <br />
  99. <code>~$ssh git@teknik.io D unlock u/[username]/[repository]</code>
  100. <br />
  101. <code>~$ssh git@teknik.io D rm u/[username]/[repository]</code>
  102. <br />
  103. </p>
  104. <h3>More Information</h3>
  105. <p>
  106. <div class="bs-callout bs-callout-warning">
  107. <h4>Repository Name</h4>
  108. <p>
  109. When defining [repository], leave off the trailing .git</b>
  110. </p>
  111. </div>
  112. <br />
  113. For more information on the commands available to you, just type: `~$ssh git@teknik.io help`
  114. <br />
  115. </p>
  116. <h3>Examples</h3>
  117. <p>
  118. <b>Clone a Repo (Git Daemon):</b> <code>~$git clone git://teknik.io/u/[username]/[repository_name]</code>
  119. <br />
  120. <b>Clone a Repo (SSH):</b> <code>~$git clone git@teknik.io:u/[username]/[repository_name]</code>
  121. </p>
  122. </div>