.. python_repo: Python Repo =========== Synchronisation of a Python repository from Bitbucket to the VM. 1. Generate SSH Key ------------------- If not already done, generated an SSH key with the command: .. code:: ssh-keygen -t rsa -b 4096 -C "logistics@moehring.ch" | 2. Add SSH Key to SSH Agent --------------------------- Add the SSH private key to the SSH agent: .. code:: ssh-add ~/.ssh/id_rsa | 3. Copy the content of the public key ------------------------------------- Copy the content of the public key (located at ``~/.ssh/id_rsa.pub``): .. code:: cat ~/.ssh/id_rsa.pub | 4. Add the content to the Bitbucket account ------------------------------------------- Navigate to Bitbucket Settings > SSH keys and add a new SSH key with the content of the public key (see `Bitbucket SSH keys `__). | 5. Clone the repository ----------------------- Initially: clone the repository (for example ``odoo_xmlrpc_twisted``) using the SSH URL: .. code:: cd /usr/local/logistics/Python/repo git clone git@bitbucket.org:Logistics_Project/odoo_xmlrpc_twisted.git | 6. Pull code from Bitbucket --------------------------- Ongoing: Pull code from Bitbucket (according to `Pull code from Bitbucket `__). Change to the local directory: .. code:: cd /usr/local/logistics/Python/repo/odoo_xmlrpc_twisted Check the status .. code:: git status Discard all changes in the local directory .. code:: git restore . Pull changes from Git .. code:: git pull --all