Create remote repository from local (bitbucket/github)

Command to use:

Set up bitbucket ssh access.

Open a terminal in local directory and run:

git init
git checkout -b feature-branch

Create repository in Bitbucket and get the ssh url by clicking on the clone button.

In yout terminal run:

git remote add origin git@bitbucket.org:nicolashoquet/arcade.git

In case “origin” already exists, you can rename origin by running this command:

git remote rename origin https-origin

or use another name for origin (e.g. ssh-origin).

Set git ssh access for github or bitbucket

https://docs.github.com/en/github/getting-started-with-github/setting-your-username-in-git

Open a terminal

cd in the folder were you want to clone the repo:

$ cd directory/you/clone
$ git init
$ git config user.name “Your-Username” #can be different from your github username
$ git config user.email “your.email@example.com
$ ssh-keygen -t rsa -C “your.email@example.com

Enter file in which to save the key (/home/username/.ssh/id_rsa): /home/username.ssh/id_rsa

Copy the content of the id_rsa.pub in your Github settings in your profile.

Set Github local authentication to be able to clone and push:

http://kbroman.org/github_tutorial/pages/first_time.html