Development using git:Cgit: Difference between revisions
No edit summary |
|||
Line 6: | Line 6: | ||
Create a directory on your local computer or somewhere you have access. If you already have an exisiting git repository, skip this section. | Create a directory on your local computer or somewhere you have access. If you already have an exisiting git repository, skip this section. | ||
{{cmd|mkdir | {{cmd|mkdir mytest | ||
cd | cd mytest}} | ||
init git and create a first commit | init git and create a first commit | ||
{{cmd|echo "testing" > test.txt | {{cmd|echo "testing" > test.txt | ||
Line 18: | Line 18: | ||
{{cmd|cd .. | {{cmd|cd .. | ||
git clone --bare | git clone --bare mytest mytest.git}} | ||
Set the description | Set the description | ||
{{cmd|echo "My git/cgit test | {{cmd|echo "My git/cgit test" > mytest.git/description}} | ||
Set the section and your name for cgit. | Set the section and your name for cgit. | ||
{{cmd|<nowiki>cat <<EOF >> | {{cmd|<nowiki>cat <<EOF >> mytest.git/cgitrc | ||
> section=Developer Your_alias | > section=Developer Your_alias | ||
> owner=Your_full_name | > owner=Your_full_name | ||
Line 36: | Line 36: | ||
Copy the content to your the ~/cgit directory on [http://git.alpinelinux.org/ git.alpinelinux.org]. | Copy the content to your the ~/cgit directory on [http://git.alpinelinux.org/ git.alpinelinux.org]. | ||
{{cmd|scp -r | {{cmd|scp -r myrepo.git git.alpinelinux.org:cgit/}} | ||
== Clean up == | == Clean up == | ||
We no longer need the local aports.git directory. | We no longer need the local aports.git directory. | ||
{{cmd|rm -rf | {{cmd|rm -rf myrepo.git}} | ||
== Last step == | == Last step == | ||
Line 50: | Line 50: | ||
So far git does not know anything about about your repositories. | So far git does not know anything about about your repositories. | ||
{{Cmd|cd | {{Cmd|cd myrepo | ||
git remote add origin ssh://git.alpinelinux.org/gitroot/username/ | git remote add origin ssh://git.alpinelinux.org/gitroot/username/myrepo.git}} | ||
== Add upstream source to merge with == | == Add upstream source to merge with == |
Revision as of 09:41, 7 May 2014
This material is proposed for merging ... It should be merged with Development using git:Developer repositories. It's not easy at a glance to sort out what's (i) general info about using cgit (for any project), and what's (ii) specific to coordinating with the Alpine developer repositories. Might we either merge these pages, or segregate the information into (i) and (ii)? (Discuss) |
Developers with SSH access can publish their repositories on cgit at git.alpinelinux.org.
Create a repository
Create a directory on your local computer or somewhere you have access. If you already have an exisiting git repository, skip this section.
mkdir mytest cd mytest
init git and create a first commit
echo "testing" > test.txt git init git add . git commit -m 'initial commit'
Create a bare repo
Clone it to a bare repo
cd .. git clone --bare mytest mytest.git
Set the description
echo "My git/cgit test" > mytest.git/description
Set the section and your name for cgit.
cat <<EOF >> mytest.git/cgitrc > section=Developer Your_alias > owner=Your_full_name > EOF
Upload to git.alpinelinux.org
Copy the content to your the ~/cgit directory on git.alpinelinux.org.
scp -r myrepo.git git.alpinelinux.org:cgit/
Clean up
We no longer need the local aports.git directory.
rm -rf myrepo.git
Last step
Now ping ncopa or somebody else on IRC in #alpine-devel with the corresponding permissions to create symlinks on git.alpinelinux.org and your repository will show up. Once the symlink is created all further repositories will be published on git.alpinelinux.org.
Add your personal repository
So far git does not know anything about about your repositories.
cd myrepo git remote add origin ssh://git.alpinelinux.org/gitroot/username/myrepo.git
Add upstream source to merge with
If the project you uploaded is a clone of an existing repository (aports for example), add the original source as a git remote repository ("upstream" can be whatever name you want to assign to the remote repository):
git remote add upstream git://git.alpinelinux.org/aports
Then, to synchronize your local copy with upstream then push your changes (might need to fix merge conflicts if/when they happen):
git pull upstream master git push
The quick way
cd .. git clone --bare acf-mystuff acf-mystuff.git echo "My acf-mystuff repo" > acf-mystuff.git/description echo "section=Developer user" > acf-mystuff.git/cgitrc scp -r acf-mystuff.git user@dev.alpinelinux.org:cgit/