From 075491c09c5cfcfd7cc43063ec0f587dff53b24c Mon Sep 17 00:00:00 2001 From: Will Budic Date: Fri, 16 May 2025 09:15:58 +1000 Subject: [PATCH] upd. --- .../git_installation_with_gitweb.md | 95 +++++++++++-------- 1 file changed, 58 insertions(+), 37 deletions(-) diff --git a/configuration_notes/git_installation_with_gitweb.md b/configuration_notes/git_installation_with_gitweb.md index cf92064..9008478 100644 --- a/configuration_notes/git_installation_with_gitweb.md +++ b/configuration_notes/git_installation_with_gitweb.md @@ -1,20 +1,15 @@ # Git Installation For Developers Steps - 1. [Add User on server where git-daemon.service is running.](#adding-user) - 1. Add the user to the git group. - * It is advised to use same user name for both client and server. - * It might be possible and desirable that shares a home directory on server, that is restricted just to allow public remote access. - - 2. [Create public ssh key for authorized access to the server.](#create-public-key-on-client) - - - 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``` - - - 5. [Git add, commit, push from the server if it is an initial new repository.](#git-add--commit) +- [Git Installation For Developers Steps](#git-installation-for-developers-steps) + - [Adding User](#adding-user) + - [Add git account first, if not already there](#add-git-account-first-if-not-already-there) + - [Adding Without Shell Access Method](#adding-without-shell-access-method) + - [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 Import From Remote](#git-import-from-remote) + - [Git Add \& Commit](#git-add--commit) + - [Creating \& Adding Auto-login Authorization keys for the Server.](#creating--adding-auto-login-authorization-keys-for-the-server) --- @@ -31,13 +26,13 @@ ### Adding Without Shell Access Method * These are system type of accounts. That share same home directory which the admin allow can public service access to an shared home. * Setting to a shared home in /tmp somewhere is not recommended. As on reboot the system might wipe the tmp dir. - -```bash -mkdir /home/dev_share -chown -R git:git /home/dev_share -useradd -r -s /bin/false -g git --home /home/dev_share dev_user -password dev_user -``` + * Creating **dev_user** for git access example: + ```bash + mkdir /home/dev_share + chown -R git:git /home/dev_share + useradd -r -s /bin/false -g git --home /home/dev_share dev_user + password dev_user + ``` ### Adding With Shell Access as Remote * This links to remote bash shell if any special to system. @@ -79,10 +74,34 @@ useradd -r -s /usr/bin/rbash -g git --home /home/dev_share dev_user ``` git clone /srv/git/PerlCNFWEBServer.git ```

-To Top of Page +[ To Top of Page ]

+## Git Import From Remote +```bash +git clone git://lifelog.hopto.org/PerlCNFWEBServer +``` + - Modify .git/config to enable to git push. +``` +[core] + repositoryformatversion = 0 + filemode = true + bare = false + logallrefupdates = true +[remote "origin"] + url = {user_name_on_server_that_is_in_the_git_group}@lifelog.hopto.org:/srv/git/wb-docs + fetch = +refs/heads/*:refs/remotes/origin/* +[branch "master"] + remote = origin + merge = refs/heads/master + +``` + - {The user_name_on_server_that_is_in_the_git_group} would be for our example **dev_user** created at the beginning of this document. +

+ Jump to [ Add User ] | + [ Top of Page ] +

## Git Add & Commit - Check the ```git branch``` @@ -91,25 +110,27 @@ useradd -r -s /usr/bin/rbash -g git --home /home/dev_share dev_user - Add directory with ```git add some_dir``` - Git commit to stage ```git commit -m'..some short description...'``` - Finally push to repository ```git push``` + - You will be asked for password. + - Otherwise create an authorization public key on workstation, to be added to the server.

-To Top of Page +[ To Top of Page ]

+## Creating & Adding Auto-login Authorization keys for the Server. + @TODO + --- - - -#### **Table Of Contents** -- [Git Installation For Developers Steps](#git-installation-for-developers-steps) - - [Adding User](#adding-user) - - [Add git account first, if not already there](#add-git-account-first-if-not-already-there) - - [Adding Without Shell Access Method](#adding-without-shell-access-method) - - [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) - - [**Table Of Contents**](#table-of-contents) +|Doc Attributes|Value| +|---|---| +|Doc Author | Will Budić | +|Doc Origin | [https://lifelog.hopto.org/gitweb/dev_notes/git_installation_with_gitweb.md](https://lifelog.hopto.org/gitweb/?p=dev_notes.git;a=blob;f=configuration_notes/git_installation_with_gitweb.md;h=cf920646c042f75f1bbdcdb304b78e4bde4a3361;hb=HEAD) | +|Doc Created| 2025-05-15 | +|Doc Last Updated| 2025-05-15 15:54:41 | + +

+[ To Top of Page ] +

- \ No newline at end of file -- 2.34.1