Development using git with write access: Difference between revisions

From Alpine Linux
(→‎Upload the new project: Changed path when uploading a project. Cgit looks for /home/user/cgit for projects to publish)
m (Redirecting to Development using git)
Line 1: Line 1:
This document is for developer who has ssh login and write access to the git repositories.
#REDIRECT [[Development_using_git]]
 
== Personal settings ==
Unless you already done so, start by setting up name and email address for the git commits.
 
{{Cmd|git config --global user.name "Your Full Name"
git config --global user.email "your@email.example.com"}}
 
== Git Clone ==
Some examples:
 
{{Cmd|git clone ssh://username@git.alpinelinux.org/gitroot/acf-core
git clone ssh://username@git.alpinelinux.org/gitroot/pingu}}
 
== 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 with 'git clone --bare ...' as described below in section 'Upload the new project'}}
 
== Git Tag ==
Create an annotated tag and push it.
 
{{Cmd|git tag -a ''tagname'' -m'commit message (e.g release 1.x)'
git push && git push --tags}}
 
== Create new project ==
Create your own dir that you want to become your new acf-mystuff project.
{{Cmd|mkdir|acf-mystuff
cd acf-mystuff
git init}}
 
Create your files and add/commit them to your git-project
{{git add ./
git commit}}
 
{{Note|You can add/modify/commit as much as you want before uploading it to git.alpinelinux.org}}
 
=== Upload the new project ===
{{Cmd|<nowiki>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/</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 17:13, 4 July 2011