Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:manual:contrib:git_contribution_guide [2022/03/26 20:03]
i3_relativism [Hyperbola Source Contribution Guidelines] add missing bash box
en:manual:contrib:git_contribution_guide [2023/02/22 20:26] (current)
throgh [Clonning repos]
Line 1: Line 1:
-<note warning> This page is still in progress, so please dont aprove this draft yet!</note> +====== Git Contribution Guidelines ====== 
-====== Hyperbola Source Contribution Guidelines ======+===== SSH =====
  
-== were <user> its your username eg: newcontributor == 
 == for the remote git management you have these two commands: == == for the remote git management you have these two commands: ==
  
Line 10: Line 9:
 </code> </code>
  
-with ssh to team or your repo you can only use 4 commands+<note><user> its your username eg: newcontributor</note> 
 + 
 +==== Comands ==== 
 + 
 +with ssh to team or your repo you can only use 4 commands
 +  * "list" is for listing repositories 
 +  * 'description' for adding a description or a title to that repo 
 +  * 'make' to create a repository 
 +  * 'remove' to remove 
 + 
 +type the command <color #0B71B9/#DDF1FF>'make'</color> for example 
 +when it says  <color #B90B0B/#FFDDDD>'Please specify the address of the Git repository'</color> its asking for the folder name 
 + 
 +for example <color #0B71B9/#DDF1FF>'documentation'</color> is the folder for many repositories like guide.git were i have uploaded my file then it prints Please specify the name of the Git repository: 
 + 
 +to create "documentation/guide.git" in the remote repo team or <user>, you cant type: 
  
 <code bash> <code bash>
-# "list" is for listing repositories +guide
-# 'description' for adding a description or a title to that repo +
-# 'make' to create a repository +
-# 'remove' to remove+
 </code> </code>
- 
-# type the command make for example 
-# when it says Please specify the address of the Git repository: 
-# its asking for the folder name 
-# for example "documentation" is the folder for many repositories 
-# like guide.git were i have uploaded my file 
-# then it prints Please specify the name of the Git repository: 
-# you cant type: "guide" 
-# to create "documentation/guide.git" in the remote repo team or <user> 
  
 To create folders in your local machine, open your terminal and type as follow: To create folders in your local machine, open your terminal and type as follow:
Line 36: Line 38:
 To end up create these folders: To end up create these folders:
  
 +<code bash>
 # GIT/team/documentation # GIT/team/documentation
 # GIT/team/hyperbolabsd # GIT/team/hyperbolabsd
Line 41: Line 44:
 # GIT/team/services # GIT/team/services
 # GIT/team/software # GIT/team/software
 +</code>
 +
 +===== Cloning repositories =====
  
 Now go to team/packages: Now go to team/packages:
Line 48: Line 54:
 </code> </code>
  
-[x@localhost packages]$  +Clone the repositories core and extra:
-Clone the repositories:+
  
 <code bash> <code bash>
Line 56: Line 61:
 </code> </code>
  
-Then cd to the extra repository:+===== Create your branch ===== 
 + 
 +cd (=change directory) into to the extra repository:
  
 <code bash> <code bash>
Line 65: Line 72:
  
 <code bash> <code bash>
-git branch <user>   # example "git branch quiliro" to create a new branch+git branch <user>   # to create a new branch
 git checkout <user>   # to switch to your branch git checkout <user>   # to switch to your branch
 </code> </code>
 +
 +===== Edit, add and remove files ======
  
 Create the files you want to add to extra repository and type:  Create the files you want to add to extra repository and type: 
  
 <code bash> <code bash>
-git add file1 file2 +git add .
-git commit -m "Add your commit comment here" +
-  +
 </code> </code>
- 
-<note tip>This is used to add all commits, -am might also be used to do both at the same time</note> 
  
 <code bash> <code bash>
-git commit -a -m "Add your commit comment here"+git commit -sam "Add your commit comment here"
 </code> </code>
  
-To push and pull from the team repository make these changes inside team/packages/extra/.git/config  
  
-=== Change <user> to your username: ===+ 
 +<note tip>To push and pull from the team repository make these changes inside team/packages/extra/.git/config </note> 
 + 
 +==== Change <user> to your username: ====
  
 <code bash> <code bash>
Line 100: Line 107:
  remote = origin  remote = origin
  merge = refs/heads/master  merge = refs/heads/master
-[branch "milky-way-v0.4"] 
- remote = origin 
- merge = refs/heads/milky-way-v0.4 
 [branch "<user>"] [branch "<user>"]
  remote = origin  remote = origin
Line 115: Line 119:
 </code> </code>
  
-To merge commits to the master branch +To merge commits from master branch 
  
 <code bash> <code bash>
-git checkout master  +git checkout <user> 
-git merge <user>+git merge master
 </code> </code>
  
Line 125: Line 129:
  
 <code bash> <code bash>
-git push origin master   # to push commits to the master branch +git push   # to push commits in the current branch
 </code> </code>
 +
 +===== Reverting commits =====
  
 We countinue with more git commands We countinue with more git commands
Line 137: Line 143:
 git revert $commit_checksum   # the best way to avoid piss off the work of the other members git revert $commit_checksum   # the best way to avoid piss off the work of the other members
 </code> </code>
- 
-=== Git Revert === 
  
 If you would revert this commit -> https://git.hyperbola.info:50100/packages/extra.git/commit/?id=85b468a2c03371c4e3550a0ddc529a9df376e6ae If you would revert this commit -> https://git.hyperbola.info:50100/packages/extra.git/commit/?id=85b468a2c03371c4e3550a0ddc529a9df376e6ae
Line 157: Line 161:
 git push --force git push --force
 </code> </code>
 +
 +===== Rebasing codebase =====
  
 However, please don't use this command in master, for that reason i'm insisting for each user to create their own branches. However, please don't use this command in master, for that reason i'm insisting for each user to create their own branches.
Line 165: Line 171:
 git push origin master && git push origin <user>   # to push them (in your case) git push origin master && git push origin <user>   # to push them (in your case)
 </code> </code>
 +
 +===== Pushing changes =====
  
 Remember to push those commits to master and milky-way-v0.4 branches if you consider those ones stable and tested by you first because I will pull them to our build server to build and push to repos. Remember to push those commits to master and milky-way-v0.4 branches if you consider those ones stable and tested by you first because I will pull them to our build server to build and push to repos.
Line 173: Line 181:
 </code> </code>
  
-==== Conclusion ====+====== Conclusion ======
  
 So, in short, you have 2 ways to push your commits: So, in short, you have 2 ways to push your commits:
Line 181: Line 189:
 === Aknowlegments === === Aknowlegments ===
 Hyperbola Development Team git repository use: Hyperbola Development Team git repository use:
 +Copyright 2021 rachad
 Copyright 2021 André Silva Copyright 2021 André Silva
 Copyright 2021 Quiliro Ordóñez Copyright 2021 Quiliro Ordóñez
-Copyright 2021 rachad 
 GNU Free Documentation License GNU Free Documentation License