Git switching and branch creation - the essence

First of all, complain about some cheating bloggers, assigning value to others and pasting it is your own? It's disgusting to not think about where to put your face at all!

Secondly, let me talk about the pitfalls I encountered. My project was git cloned before, so I thought it could be used directly, but then the command to view the branch did not work. In a fit of anger, I deleted the git file Yes, start over. .

git init 
git add .
git commit -m "你的描述信息"

// 由于是新的git, 所以需要关联一下远程数据库
git remote add  origin (git地址,直接origin 后面跟就可以,注意空格,不带括号)
// 这个时候不要急着去push, 因为我们要创建分支

//我就说一个, 创建及切换分支,其他的百度一搜就可以找到。
git checkout -b "你的分支名称"
// 这个试试会自动切换到你的分支下面, 
// 如果不确定,可以使用下面的 命令
git status 

//带星号的就是当前分支,

// 然后开始推。

git push origin "分支名称":"远程仓库分支名称"

// 如果两个是一样的话,那么只写分支名称就可以了。

Finished spreading flowers, leave a message if you have any questions.

Guess you like

Origin blog.csdn.net/a_Chaon/article/details/88061065