ssh-keygen -t rsa -C "<email-address>" Generate ssh-keygit init [dir] initialize from localgit init --bare [dir] Create a local bare repositorygit clone <git-url> [dir] initialize from a remote repositorygit clone [--branch tag-name/branch-name] <git-url> [dir] Download and bind the specified branchgit clone --bare <git-url> [dir] Clone the remote repository baregit clone --mirror <git-url> [dir] Create a mirror repositorygit remote set-url <remote-host-name> <new-git-url> Change remote repository addressmkdir example
cd example
git init
git remote add origin git@gitlab.com:trensy/cheatsheet.git
#pull the remote branch
git pull origin master
#Push data to the remote branch, or create a remote branch with the same name if it doesn't exist
git push -u origin master
mkdir example.git
cd example.git
git init --bare .
git clone --bare git@gitlab.com:trensy/cheatsheet.git
git remote add origin git@gitlab.com:trensy/cheatsheet_new.git
git push --mirror origin
git clone --mirror git@gitlab.com:trensy/cheatsheet.git
git remote update
git remote add origin git@gitlab.com:trensy/cheatsheet_new.git
git push --mirror origin
git remote set-url origin git@gitlab.com:trensy/cheatsheet.git