Things they won't tell You while configuring Gitweb

Just installing Gitweb

I used this tutorial to install and run Gitweb. There is backup on archive.org.

Files, locations, configuration

Files you might be interested in:

How to add author in repo

Enter repo (ex. /var/lib/git/test.git), open file config in text editor, and add these lines:

[gitweb]
  author = Your author name
    

For more options, see this link (ctrl-f -> "gitweb."): https://git-scm.com/docs/git-config

How to use git remotely using ssh

When I was younger, it was hard for me to understand how git works on remote repos. This should give You an idea how to get down to it. At this point You should have installed and configured gitweb, added linux "git" user with home directory, and updated it's ~/.ssh/authorized_keys with Your ~/.ssh/id_rsa.pub which You can generate using ssh-keygen.

Creating repository

As git user, enter /var/lib/git directory. Now to create new repository, use git init --bare repository_name.git. At this point, You should have Your directory visible, but I would suggest to add gitweb author in repo_name.git/config and modify repo_name.git/description.

Pulling remote repository

Clone the repository using git clone ssh://git@server_ip:server_port/var/lib/git/repository_name.git. It might ask You for git user password if You didn't update authorized_keys on Your server. Now I would suggest to configure Your identity for this repo, or for global use. For this, use git config --global user.name "FIRST_NAME LAST_NAME" and git config --global user.email "YOUR_EMAIL". Remove --global flags to use this information only in this repository. Keep in mind You need to be in this repository directory on Your local machine to make these changes.

Pushing changes

With new files in Your local directory, You need to add them to repository using git add file.txt (You can use wildcards*). Now, You're in commit stage. Use git commit to open text editor with full push note, or use git commit -m "simple note" for simple one line note. Make sure to write changes in text editor before closing, otherwise git will cancel commit operation. Finally, push changes to server, using git push origin master.