From 87bdf524d122c5f0a22be485c30ec71c7301fff0 Mon Sep 17 00:00:00 2001 From: Will Budic Date: Thu, 15 May 2025 21:41:51 +1000 Subject: [PATCH] . --- .../git_installation_with_gitweb.md | 45 ++++++++++++++----- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/configuration_notes/git_installation_with_gitweb.md b/configuration_notes/git_installation_with_gitweb.md index b6f74bf..6428e41 100644 --- a/configuration_notes/git_installation_with_gitweb.md +++ b/configuration_notes/git_installation_with_gitweb.md @@ -10,16 +10,15 @@ 3. [Create /srv/git/some_repository](#create-on-server-global-repository) * Change permissions to git group for some_repository. -4. - * git clone /srv/git/some_repository with: ```git clone some_user@server:/srv/git/some_repository``` + 4. git clone /srv/git/some_repository with: + ```git clone some_user@server:/srv/git/some_repository``` - 4. [Git add, commit, push from the server if it is an initial new repository.](#git-add--commit) + 5. [Git add, commit, push from the server if it is an initial new repository.](#git-add--commit) --- - > This document is under editing. - + > This document is currently being edited. --- @@ -56,21 +55,45 @@ useradd -r -s /usr/bin/rbash -g git --home /home/dev_share dev_user ## Create On Server Global Repository ```bash + su -i root mkdir /srv/git/PerlCNFWEBServer.git chown -R git:git /srv/git/PerlCNFWEBServer.git/ cd /srv/git/PerlCNFWEBServer.git touch git-daemon-export-ok - cd /srv/git - git init --bare --shared=group -b master PerlCNFWEBServer.git + git init --bare --shared=group -b master . ``` + ``` + git help init excerpt: + --bare + Create a bare repository. If GIT_DIR environment is not set, it is set to the current working directory. + --shared[=(false|true|umask|group|all|world|everybody|0xxx)] + Specify that the Git repository is to be shared amongst several users. This allows users belonging to the same group to push into that repository. When specified, the config + variable "core.sharedRepository" is set so that files and directories under $GIT_DIR are created with the requested permissions. When not specified, Git will use permissions + reported by umask(2). + -b , --initial-branch= + Use the specified name for the initial branch in the newly created repository. If not specified, fall back to the default name (currently master, but this is subject to change in + the future; the name can be customized via the init.defaultBranch configuration variable) + ``` + - Clone somewhere as the user on the server the new repository as local to start adding files to it. Branch should default to master. + ``` git clone /srv/git/PerlCNFWEBServer.git ``` + +

+To Top of Page +

- -[Top](#git-installation-for-developers-steps) ## Git Add & Commit + - Check the ```git branch``` + - Check git status ```git status ``` + - Add new file with ```git add some_file.ext``` + - Add directory with ```git add some_dir``` + - Git commit to stage ```git commit -m'..some short description...'``` + - Finally push to repository ```git push``` -[Top](#git-installation-for-developers-steps) +

+To Top of Page +

--- @@ -85,7 +108,7 @@ useradd -r -s /usr/bin/rbash -g git --home /home/dev_share dev_user - [Adding With Shell Access as Remote](#adding-with-shell-access-as-remote) - [Create Public Key on Client](#create-public-key-on-client) - [Create On Server Global Repository](#create-on-server-global-repository) - - [Git Add & Commit](#git-add--commit) + - [Git Add \& Commit](#git-add--commit) - [**Table Of Contents**](#table-of-contents) \ No newline at end of file -- 2.34.1