viernes, 27 de junio de 2025

Development Workflow

  1. Create a new branch from develop
    git pull
    Replace:
    <branchStrategy> with feature, bugfix, release, hotfix
    <module> with backend, frontend, ml, docs, infrastructure
    git checkout -b <branchStrategy>/<module>-<description> develop
    Example: git checkout -b feature/backend-pdf-handler develop

  2. Make your changes on the files, and upload to the repo.
    git add <file>
    Replace <type> with a Commit Message type, check the top table Commit Message Type.
    git commit -m '<type>: Add basic pdf handler.'
    Example: git commit -m 'feat: Add basic pdf handler.'
    git status
    git push --set-upstream origin <branchStrategy>/<module>-<description>
    Example: git push --set-upstream origin feature/backend-pdf-handler

  3. Write/update tests

  4. Update documentation

  5. Submit a pull request

jueves, 26 de junio de 2025

git branch managment

Sometimes we have plenty of branches on git, and we should keep the order on the team. Here is how to remove the branches and be on sync with the remote repo.

Refresh the remote branch information
git fetch --prune origin

Current state of the remote branches
git branch -r

Delete origin branchgit branch -d feature/backend-storage
git branch -d feature/git-integration

Delete the feature/git-integration remote branch instead
git push origin --delete feature/git-integration

viernes, 20 de junio de 2025

Configure gh on Ubuntu

 Install with the repository

# Add GitHub CLI repository
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null

# Update and install
sudo apt update
sudo apt install gh

 

Then login:

alejandro@minipc:~/Documents/Work/Project/deep_privacy2$ gh auth login
? Where do you use GitHub? GitHub.com
? What is your preferred protocol for Git operations on this host? HTTPS
? Authenticate Git with your GitHub credentials? Yes
? How would you like to authenticate GitHub CLI? Login with a web browser

! First copy your one-time code: 2636-****
Press Enter to open https://github.com/login/device in your browser...
Opening in existing browser session.
✓ Authentication complete.
- gh config set -h github.com git_protocol https
✓ Configured git protocol
✓ Logged in as alegarciadelrio
alejandro@minipc:~/Documents/Work/Project/deep_privacy2$