1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | // Initialise git init . // Initialise a repo // To use main instead of default master git init --initial-branch=main git init -b main // Credentials git config --global user.name <name> git config --global user.email <email> git config --global credential.helper store git config --global github.user myusername git config --global github.token mytoken git config --global init.defaultBranch main // Adding files git add . git add * git add <filename> git commit -m "<message>" // Remote Repos git remote add <name> <url> git fetch <remote> <branch> git pull <remote> git push <remote> <branch> git push <remote> --force git push <remote> --all // Branching git branch git checkout -b <branch> git checkout <branch> // Marging git merge <branch> giot rebase <base> // See https://www.atlassian.com/git/tutorials/merging-vs-rebasing |