git init git remote add origin git@<the address>/<repo name>.git git checkout -b <branch_name> # create a new branch git branch --show-current # check we are currently in which branch git add . git commit -m "Initial commit" git push -u origin <branch_name>
clone branch
Code
git clone --branch <branch-name> <repository-url>
show the current branch
Code
git branch --show-current
Check git config user account
This command will display all your Git configurations, including your username, email address, and other settings.
Code
git config --list
To set a global configuration that applies to all repositories on your machine, use the –global flag with the git config command. For example, to set your global username and email, you can use the following commands:
To set a local configuration that applies only to a specific repository, navigate to the repository’s directory in the terminal. Then, use the git config command without the –global flag. For example, to set the username and email for a specific repository, you can use the following commands: