## 🧭 FULL CLI-ONLY WORKFLOW (Ubuntu + Bitbucket) --- ### πŸ”Ή Step 1 β€” Install prerequisites ```bash # Install Git sudo apt update sudo apt install git -y # Install cURL and OpenSSH if not already sudo apt install curl openssh-client -y ``` --- ### πŸ”Ή Step 2 β€” Create a Bitbucket account Go to: [https://bitbucket.org/account/signup](https://bitbucket.org/account/signup) > You’ll need to verify email, set username, and generate an **App Password** with at least: > > * `Repository` (read/write) > * `SSH` (read/write) --- ### πŸ”Ή Step 3 β€” Set your global Git identity ```bash git config --global user.name "Your Name" git config --global user.email "your_email@example.com" ``` --- ### πŸ”Ή Step 4 β€” Generate and register your SSH key ```bash # Generate SSH key (if not already present) ssh-keygen -t rsa -b 4096 -C "your_email@example.com" -f ~/.ssh/id_rsa -N "" # Start SSH agent eval "$(ssh-agent -s)" # Add key to agent ssh-add ~/.ssh/id_rsa ``` Then copy your public key: ```bash cat ~/.ssh/id_rsa.pub ``` Paste it into: πŸ” **Bitbucket β†’ Personal settings β†’ SSH keys β†’ Add key** --- ### πŸ”Ή Step 5 β€” Create your local project ```bash mkdir myproject cd myproject git init echo "# My Bitbucket Project" > README.md git add . git commit -m "Initial commit" ``` --- ### πŸ”Ή Step 6 β€” Create a new Bitbucket repo (via browser) Unfortunately, **Bitbucket does not have a CLI tool** for creating repositories. ➑️ Go to: [https://bitbucket.org/repo/create](https://bitbucket.org/repo/create) Create a **public** or **private** repo named the same as your folder (e.g., `myproject`). > Ensure it's an **empty repo** (don’t initialize with README or .gitignore). --- ### πŸ”Ή Step 7 β€” Link local repo to Bitbucket via SSH ```bash # Use the SSH format: git remote add origin git@bitbucket.org:your_username/myproject.git # Verify connection ssh -T git@bitbucket.org ``` --- ### πŸ”Ή Step 8 β€” Push to Bitbucket ```bash # Set upstream branch git push -u origin master # or main ``` --- ### πŸ”Ή Step 9 β€” Make further commits ```bash # Edit files nano something.txt # Stage, commit, push git add . git commit -m "Updated something" git push ``` --- ### πŸ”Ή Bonus β€” Clone a Bitbucket repo ```bash # Clone using SSH git clone git@bitbucket.org:your_username/your_repo.git ``` --- ### πŸ”’ Tip β€” Use SSH for all Bitbucket CLI work Bitbucket heavily rate-limits HTTPS for CLI usage without app passwords. Always prefer `SSH` for full CLI-based workflows. ---