Publish developer repositories on cgit: Difference between revisions

From Alpine Linux
(Redirecting to Development using git:Cgit)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
Developers with ssh access can publish their repositories repositories on cgit.
#REDIRECT [[Development_using_git:Cgit]]
 
== Create a repository ==
Create a directory on your private computer
{{cmd|mkdir mytest
cd mytest}}
init git and create a first commit
{{cmd|echo "testing" > test.txt
git init
git add .
git commit -m 'initial commit'}}
 
== Create a bare repo ==
Clone it to a bare repo
{{cmd|cd ..
git clone --bare mytest mytest.git}}
 
Set the description
{{cmd|echo "My git/cgit test" > mytest.git/description}}
 
== Publish it on git.alpinelinux.org ==
Set the section for cgit
{{cmd|vim mytest.git/cgitrc}}
Add something like this to the file
section=Developer ncopa
 
Copy the content to ~/cgit dir on [http://git.alpinelinux.org/ git.alpinelinux.org]
{{cmd|scp -r mytest.git git.alpinelinux.org:cgit/}}
 
== Clean up ==
We no longer need the local bare repository.
{{cmd|rm -rf mytest.git}}
 
== Add upstream source to merge with ==
If the project you uploaded is a clone of an existing repo (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):
{{cmd|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):
{{cmd|git pull upstream master
git push}}
 
== Git Push (Distributed Workflows) ==
If working with [http://book.git-scm.com/3_distributed_workflows.html 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)''.
{{cmd|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.
{{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'}}

Latest revision as of 11:24, 5 July 2011