User Tools

Site Tools


howto-git

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
howto-git [2014-06-30 17:37]
glen
howto-git [2016-03-21 10:36] (current)
glen looks like sskm allows add conflicting names, and then ends up getting stuck
Line 25: Line 25:
 </​code>​ </​code>​
  
-One can do it per package too in each ''​./​.git/​config''​ file: +One can do it per package too in each ''​./​.git/​config''​ file: <file ini> 
-  [user] +[user] 
-        email = <​your_login>​@pld-linux.org +    email = <​your_login>​@pld-linux.org 
-        name = Your Name+    name = Your Name 
 +</​file>​
 but as for now one needs to set it in each package fetched. but as for now one needs to set it in each package fetched.
  
 If you have an RW access to PLD Linux repositories please use If you have an RW access to PLD Linux repositories please use
-your PLD Linux alias <​your_login>​@pld-linux.org>​ as email.+your PLD Linux alias ''​<​your_login>​@pld-linux.org>​'' ​as email. 
 + 
 +If you have github account and wish github mirror being updated with your credentials (referencing github resources, closing pull request), you may wish to setup SSH Agent forwarding so that github sync is performed with your credentials. You need to have same key or github key in ssh agent. Such ''​~/​.ssh/​config''​ will enable SSH agent forwarding when pushing: <file - ~/​.ssh/​config>​ 
 +Host git.pld-linux.org 
 +    ForwardAgent ​   yes 
 +</​file>​
  
 Additionally some useful git config: Additionally some useful git config:
  
-Enable colored ​difs ([[http://​live.gnome.org/​Git/​Developers|reference]]) <​code>​+Enable colored ​diffs ([[http://​live.gnome.org/​Git/​Developers|reference]]) <​code>​
 git config --global color.ui auto git config --global color.ui auto
 </​code>​ </​code>​
  
-Add ''​git st'' ​alias ([[https://​git.wiki.kernel.org/​index.php/​Aliases|reference]]) <​code>​+Add ''​git st'' ​and some other aliases ​([[https://​git.wiki.kernel.org/​index.php/​Aliases|reference]]) <​code>​
 git config --global alias.st status git config --global alias.st status
 git config --global alias.ci commit git config --global alias.ci commit
 git config --global alias.up pull --rebase git config --global alias.up pull --rebase
 +git config --global alias.ssh '!ssh git@git.pld-linux.org'​
 </​code>​ </​code>​
  
-when pushing in git-core-1.8.0 ([[http://​lists.pld-linux.org/​mailman/​pipermail/​pld-devel-en/​2012-October/​023231.html|reference]])+when pushing in git-core ​>= 1.8.0 ([[http://​lists.pld-linux.org/​mailman/​pipermail/​pld-devel-en/​2012-October/​023231.html|reference]])
 <​code>​ <​code>​
 git config --global push.default simple git config --global push.default simple
Line 116: Line 123:
    git push --dry-run origin master    git push --dry-run origin master
  
 +===== Modify commit messages =====
 +
 +commit messages can be annotated with ''​git notes''​ feature.
 +
 +Read more on mailing list: http://​lists.pld-linux.org/​mailman/​pipermail/​pld-devel-en/​2012-July/​022786.html
 =====Update your repository===== =====Update your repository=====
  
Line 196: Line 208:
 Often it is good idea to start working over new spec starting from spec templates available: Often it is good idea to start working over new spec starting from spec templates available:
   git clone git://​git.pld-linux.org/​projects/​template-specs.git   git clone git://​git.pld-linux.org/​projects/​template-specs.git
 +
 +===== Rename package =====
 +Assume we want lowercase python-Flask:​
 +  $ ssh git@git.pld-linux.org ​  move python-Flask ​ python-flask
 +try build to download new version:
 +  nice builder -v python-flask
 +rename spec file:
 +  $ cd python-flask/​
 +  $ git mv python-Flask.spec ​ python-flask.spec ​
 +Update spec with name change and commit changes.
  
 =====More information on git===== =====More information on git=====
Line 217: Line 239:
 Generate pair ( ''​id_rsa_matkor_pld_linux_app4''​ and ''​id_rsa_matkor_pld_linux_app4.pub''​ in my case) Generate pair ( ''​id_rsa_matkor_pld_linux_app4''​ and ''​id_rsa_matkor_pld_linux_app4.pub''​ in my case)
    ​ssh-keygen -f ~/​.ssh/​id_rsa_matkor_pld_linux_app4    ​ssh-keygen -f ~/​.ssh/​id_rsa_matkor_pld_linux_app4
 +
 +<note warning>
 +**IMPORTANT**:​ ''​@app4''​ needs to be unique. use ''​sskm list''​ to see what names are used
 +</​note>​
        
 Add it (as key ''​app4''​ in my case): Add it (as key ''​app4''​ in my case):
Line 223: Line 249:
 Confirm (using -i of new key ): Confirm (using -i of new key ):
   ssh -i ~/​.ssh/​id_rsa_matkor_pld_linux_app4 ​  ​git@git.pld-linux.org sskm confirm-add @app4   ssh -i ~/​.ssh/​id_rsa_matkor_pld_linux_app4 ​  ​git@git.pld-linux.org sskm confirm-add @app4
- 
 ===== More to read ===== ===== More to read =====
 http://​sitaramc.github.com/​gitolite/​sskm.html http://​sitaramc.github.com/​gitolite/​sskm.html
howto-git.1404142643.txt.gz · Last modified: 2014-06-30 17:37 by glen