Git

From lathama
Jump to: navigation, search

Tips and Howto

https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History

Squashing

Sadly there are too many ways to squash in Git now. Old method from my personal notes is:

Select the last few commits you want to join as one
git rebase -i HEAD~3
In the editor that started select the commits you wish to squash by using the word squash and save. Then you can push.
git push origin

Accounts

https://lathama.net/git/lathama
Github account
https://github.com/lathama

Gitea

https://gitea.io/en-US/

Install and note the version in this example is 1.3.2 and maybe some day there will be a stable branch/tag.

adduser git
su git
cd /home/git
mkdir gitea
wget -O gitea https://dl.gitea.io/gitea/1.3.2/gitea-1.3.2-linux-amd64
chmod +x gitea

Use https://github.com/go-gitea/gitea/blob/master/contrib/systemd/gitea.service for

/etc/systemd/system/gitea.service

Apache Proxy via

 <Proxy *>
  Order allow,deny
  Allow from all
 </Proxy>
 ProxyPreserveHost On
 ProxyRequests off
 ProxyPass /git http://127.0.0.1:3000
 ProxyPassReverse /git http://127.0.0.1:3000

In /home/git/gitea/custom/config/app.ini limit to localhost like:

[server]
PROTOCOL         = http
DOMAIN           = lathama.net
HTTP_ADDR        = 127.0.0.1
HTTP_PORT        = 3000
ROOT_URL         = https://lathama.net/git/

In the app.ini you can set many things like https://docs.gitea.io/en-us/config-cheat-sheet/ and example at https://raw.githubusercontent.com/go-gitea/gitea/master/custom/conf/app.ini.sample eg

APP_NAME = Lathama Git Server

Then we just need to enable and start/restart services. (I use restart a lot in the case I had already started it.)

systemctl reload apache2
systemctl enable gitea
systemctl restart gitea

Sponsorship and Advertising space here. Please contact me if interested.