Basic Git Commands

April 8, 2023 Basic Git Commands Some must-knows Git clone with token if the repo is private or need specific access git clone https://<USERNAME>:<TOKEN><OWNER>/<REPOSITORY>.git git config --global example_user git config --global [email protected] Git to store credentials in plaintext in a file (not recommended) git config --global credential.helper cache git config --global credential.helper store git clone cd some-project git switch -c main touch git add git commit -m "add README" git push -u origin main cd existing_folder git init --initial-branch=main git remote add origin git add . git commit -m "Initial commit" git push -u origin main Push an existing Git repository cd existing_repo git remote rename origin old-origin git remote add origin git push -u origin --all git push -u origin --tags If you like to use mobile App for GitLab. You can try GitBlur on AppStore. Access Token is required. Go to User Settings -> Access Tokens -> Select scop and generate token.

This is a companion discussion topic for the original entry at