Connect over HTTPS
Pushing over HTTPS works everywhere SSH does not: a locked-down network, a CI service, a script that only has a URL. It uses an access token in place of your password.
Use a token, not your account password. A token is scoped to what one machine needs and can be revoked on its own, and it keeps working after you turn on two-factor authentication, which your password will not.
Generate a token
Open Settings → Applications. Under Manage Access Tokens, give the token a name that
says what it is for (laptop, deploy-server, ci) and choose the permissions it needs.
For everyday pushing, read and write on repository is enough; leave everything else at
no access.
Click Generate Token. The token is shown once. Copy it now; Gitza cannot show it again, and if you lose it you delete it and generate another.
Use it as the password
Clone or push with the HTTPS address and give the token when asked for a password:
git clone https://git.gitza.co.za/you/your-repo.gitYour Git credential helper will offer to remember it. On macOS that is the keychain, on
Windows the Credential Manager, and on Linux git config --global credential.helper store
writes it to a file in your home directory, so treat that file as you would a key.
Revoke it when you are done
Tokens live until you delete them. When a machine is retired or a token has leaked, remove it from the same page; every clone that used it stops working immediately.
One token per job
A token is a password with a name. Give each machine and each tool its own, scoped to what it needs, so revoking one never takes anything else down and the activity log tells you which one did what.