Development using git:Cgit: Difference between revisions

From Alpine Linux
(Created page with "Developers with SSH access can publish their repositories on cgit at [http://git.alpinelinux.org/ git.alpinelinux.org]. == Create a repository == Create a directory on ...")
 
mNo edit summary
Line 27: Line 27:
> owner=Your_full_name
> owner=Your_full_name
> EOF</nowiki>}}
> EOF</nowiki>}}
{{Note|The 'description' file and 'cgitrc' file are needed to make cgit publish information about your repo.}}


Copy the content to the directory ~/cgit on [http://git.alpinelinux.org/ git.alpinelinux.org]
Copy the content to the directory ~/cgit on [http://git.alpinelinux.org/ git.alpinelinux.org]
Line 44: Line 46:
{{cmd|git pull upstream master
{{cmd|git pull upstream master
git push}}
git push}}




Line 56: Line 57:
Now 'git pull' pulls the public repo, and 'git push' pushes to '''your''' public repo.
Now 'git pull' pulls the public repo, and 'git push' pushes to '''your''' public repo.


{{Note|The path where you want to push to should first be prepared as described in above section 'Create a bare repo' and 'Publish it on git.alpinelinux.org'}}
<!--{{Note|The path where you want to push to should first be prepared as described in above section 'Create a bare repo' and 'Publish it on git.alpinelinux.org'}}
-->


Moved from another article
== The quick way ===
 
=== Upload the new project ===
{{Cmd|<nowiki>cd ..
{{Cmd|<nowiki>cd ..
git clone --bare acf-mystuff acf-mystuff.git
git clone --bare acf-mystuff acf-mystuff.git
Line 66: Line 66:
echo "section=Developer user" > acf-mystuff.git/cgitrc
echo "section=Developer user" > acf-mystuff.git/cgitrc
scp -r acf-mystuff.git user@dev.alpinelinux.org:cgit/</nowiki>}}
scp -r acf-mystuff.git user@dev.alpinelinux.org:cgit/</nowiki>}}
{{Note|The 'description' and 'cgitrc' are needed to make cgit publish information about your repo}}
More details found when reading [[Publish developer repositories on cgit]].

Revision as of 11:27, 5 July 2011

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.

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

Publish it on git.alpinelinux.org

Set the section and your name for cgit.

cat <<EOF >> mytest.git/cgitrc > section=Developer Your_alias > owner=Your_full_name > EOF

Note: The 'description' file and 'cgitrc' file are needed to make cgit publish information about your repo.

Copy the content to the directory ~/cgit on git.alpinelinux.org

scp -r mytest.git git.alpinelinux.org:cgit/

Clean up

We no longer need the local bare repository.

rm -rf mytest.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


Git Push (Distributed Workflows)

If working with Distributed Workflows you would 'pull' from public repo, 'push' to another publically accessable repo (where you have write access), main developer (who has write access to public repo) 'pulls' you changes from your pub.accessed.repo into the public repo.

To make it easier for you to work, you can configure 'git push' to push your work to your publically accessable repo ('git pull' would still pull from same repo as you cloned from).

cd /your/private/repo/where/you/work/reponame git config remote.origin.pushurl "ssh://user@dev.alpinelinux/home/user/cgit/reponame.git"

Now 'git pull' pulls the public repo, and 'git push' pushes to your public repo.


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/