What are the commands related to Git
Editor to share with you what are the commands related to Git. I hope you will get something after reading this article. Let's discuss it together.
Global Settin
Git config-- global user.name "zyl" git config-- global user.email xxx@xxx.comgit config-- list check your git setting git clone xxxxxx.git
Add a new file
Vim demo.txtgit add demo.txt adds a new file git commit-m 'this is first commit' to submit to the local warehouse and sets the comment git push to convert this to the main branch git rm xxx.txt delete file git commit-m' xxxx'; submit to the warehouse git pushgit pull pull file git log-all log git branch view all branches git log-stat xxx view the submission information of a fulcrum find .git / objects-type f view all branches
Ali Cloud related commands:
Command line instruction
Git Global Settings
Git config-global user.name "z1577121881" git config-global user.email "1577121881@qq.com"
Create a new version library
Git clone git@code.aliyun.com:z1577121881/tantou.gitcd tantoutouch README.mdgit add README.mdgit commit-m "add README" git push-u origin master
Existing folder or Git repository
Cd existing_foldergit initgit remote add origin git@code.aliyun.com:z1577121881/tantou.gitgit add. Git commit-am "some information you need to fill in" git push-u origin master
Code cloud related commands
Set global information
Git config-global user.name "your name" git config-global user.email "your Email" clone and pushgit clone http://xxxx/xxxx.git
Create a feature branch
Git checkout-b $feature_name
Submit code
Git commit-am "this is commit"
Push to specified branch
Git push origin $feature_name
For convenience, it is best to add a public key to git.
You can generate it with the following command
Ssh-keygen-t rsa-C "xxxxx@xxxxx.com" # Creates a new ssh key using the provided email# Generating public/private rsa key pair...
View public key
Cat / .ssh/id_rsa.pub# ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6eNtGpNGwstc....
After adding, enter in the terminal (Terminal)
Ssh-T git@git.oschina.net
If Welcome to Git@OSC is returned, yourname!
After reading this article, I believe you have a certain understanding of "Git-related commands". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for your reading!