- Create a ruleset that:
- Targets all branches.
- Restricts updates.
- Restricts deletions.
- Blocks force pushes.
- Disable the option
Automatically delete head branches
.
- Clone the
icub-tech-iit
fork:git remote add icub-tech https://github.com/icub-tech-iit/robots-configuration.git
- Switch to the branch corresponding to the robot (e.g.,
devel-ergoCubSN???
).
- Fine-grained PAT can be scoped to work on a specified organization and only on a specified repository.
- To store credentials locally, one needs to issue the following, once the fork is cloned locally:
git config --local user.name "icub-tech-iit-bot" git config --local user.email "icub-tech@iit.it" git config --local credential.https://github.com/icub-tech-iit/robots-configuration.git.helper store
⚠️ Note the use of the option--local
to avoid impacting Git globally on the system. - In order to push without password, the PAT needs to be provided. The credentials will be stored plainly under
~/.git-credentials
. No worries though, as this PAT has a very narrowed use and impacts a fork that is backed up anyhow by the upstream repository. - The PAT can be stored manually in
~/.git-credentials
with the formathttps://icub-tech-iit-bot:${PAT}@github
. Alternatively, when attempting to push the first time, it is enough to useicub-tech-iit-bot
as user and specifying thePAT
as password. This will be stored in the~/.git-credentials
file automatically. ⚠️ Being the local system shared, no one else should store his/her PAT in the same file.- The PAT is set to have no expiration. However, it can be revoked at any time by the maintainer.
Tip
Instead of relying on the credential helper, one can resort to a simpler method:
git remote set-url icub-tech https://x-access-token:${PAT}@github.com/icub-tech-iit/robots-configuration.git
- We do rely on Git hoooks.
- Run the following command from the
robots-configuration
root folder:git config --local core.hooksPath .githooks/
Note
To be still developed.