This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
howto-git [2012-10-17 13:55] baggins [Create new package] removed not needed info, '-u' for push does that magic |
howto-git [2014-10-02 12:29] glen |
||
---|---|---|---|
Line 7: | Line 7: | ||
=====Prepare working dirs==== | =====Prepare working dirs==== | ||
- | Move existing ''~/rpm'' directory: | + | Move existing (CVS-based) ''~/rpm'' directory: |
mv ~/rpm ~/rpm.cvs | mv ~/rpm ~/rpm.cvs | ||
| | ||
Line 17: | Line 17: | ||
cd ~/rpm/packages/ | cd ~/rpm/packages/ | ||
./builder -v -bp python-msgpack | ./builder -v -bp python-msgpack | ||
- | =====Set your configuration==== | + | ===== Set your configuration ==== |
Your identity (NOTE: This sets globally): | Your identity (NOTE: This sets globally): | ||
Line 27: | Line 27: | ||
One can do it per package too in each ''./.git/config'' file: | One can do it per package too in each ''./.git/config'' file: | ||
[user] | [user] | ||
- | email =<your_login>@pld-linux.org | + | email = <your_login>@pld-linux.org |
name = Your Name | name = Your Name | ||
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. | ||
Line 40: | Line 40: | ||
</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]]) | ||
+ | <code> | ||
+ | git config --global push.default simple | ||
+ | </code> | ||
=====Download package===== | =====Download package===== | ||
Line 55: | Line 60: | ||
slug.py clone <package> | slug.py clone <package> | ||
- | cd ~/PLD_clone/packages/<package> # FIXME: Is it ~/rpm/packages/<package> in newer vesions ? | + | cd ~/rpm/packages/<package> |
Line 73: | Line 78: | ||
usually called ''origin/master''. Clone, besides other things, creates a local | usually called ''origin/master''. Clone, besides other things, creates a local | ||
''master'' branch that tracks remote origin/master branch. | ''master'' branch that tracks remote origin/master branch. | ||
- | + | =====Commit your changes===== | |
- | =====Commit you changes===== | + | |
First you put your changes in a staging area - the index: | First you put your changes in a staging area - the index: | ||
git add file | git add file | ||
Line 113: | Line 117: | ||
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 145: | Line 154: | ||
git branch -a | git branch -a | ||
+ | ===== Pushing big files ===== | ||
+ | |||
+ | You shouldn't (can't) push bigger files than 2MiB. Big files, including patches, should be stored in distfiles. | ||
+ | |||
+ | If the file is accessible by url, just add ''# SourceX-md5: '' or ''# PatchX-md5: '' comment to the spec, and the file itself does not need to be added to git index. remove/revert if you already did. If the file is generated locally, you need to upload it to distfiles before pushing. | ||
+ | |||
+ | There's exception if you can't do that (is too hard to do due local modifications), you can add the patch filename into ''.bigfiles'' file. See [[http://lists.pld-linux.org/mailman/pipermail/pld-devel-en/2012-October/023210.html|pld-devel-en post]]. | ||
+ | |||
+ | After you found you pushed and was rejected by big file restriction, you can fix it like this (assuming it was only single commit): | ||
+ | <code bash> | ||
+ | echo 7.3.640 > .bigfiles | ||
+ | git add .bigfiles | ||
+ | git commit --amend | ||
+ | git push origin master | ||
+ | </code> | ||
=====Graphical repository browser===== | =====Graphical repository browser===== | ||
Line 178: | Line 202: | ||
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 197: | Line 231: | ||
===== Adding new key ===== | ===== Adding new key ===== | ||
- | Generate pair ( ''id_rsa_matkor_pld_linux_app4'' and ''id_rsa_matkor_pld_linux_app4.pub'' in ma 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 | ||