今天学习一下GIT命令行

2020-04-08  本文已影响0人  码天下

1:常用命令行

git init初始化当前目录,即创建Git仓库

git clone克隆远程仓库倒本地

git add 文件名.text把文件添加到GIT仓库

git commit -m "描述信息"把文件提交到本地仓库

git status 查看当前仓库文件的状态

git log 查看以前提交版本信息。

2:分支的管理

Git鼓励大量使用分支:

查看分支:git branch

切换分支:git checkout <branch name>

创建本地分支:git branch <branch name>

创建+切换本地分支:git checkout -b <branch name>

将新建的分支推到远程:git push origin <branch name>

合并某分支到当前分支:git merge <branch name> (这种合并分支不会保存分支操作记录)

强制删除本地分支:git branch -D <branch name>

删除远程分支:git push origin --delete <branch name>

上一篇 下一篇

猜你喜欢

热点阅读