查看: 12|回复: 0

[Ubuntu] Ubuntu系统怎么用git新增分支并且提交?

[复制链接]

5

主题

0

回帖

0

积分

热心网友

金币
0
阅读权限
220
精华
0
威望
0
贡献
0
在线时间
0 小时
注册时间
2008-5-23
发表于 2023-9-21 00:00:00 | 显示全部楼层 |阅读模式

今天我们就来讲讲在Ubuntu里用git新增分支并且提交的方法,很简单,请看下文详细介绍。

git branch newbh

我们创建一个新的分支newbh。

Ubuntu系统怎么用git新增分支并且提交?

git branch

就能看到当前有的分支。

Ubuntu系统怎么用git新增分支并且提交?

git checkout newbh

这样我们就能转换到newbh分支。

Ubuntu系统怎么用git新增分支并且提交?

git branch

能用颜色辨认已经切换到这个分支了。

Ubuntu系统怎么用git新增分支并且提交?

修改一下文件。

git status

git add -A

然后我们添加到暂缓区。

Ubuntu系统怎么用git新增分支并且提交?

Ubuntu系统怎么用git新增分支并且提交?

git commit -m ""

然后我们提交一下到本地版本库。

Ubuntu系统怎么用git新增分支并且提交?

Ubuntu系统怎么用git新增分支并且提交?

git push -u orgin newbh

然后我们就可以提交到远程仓库。

git branch -a

查看全部分支。

Ubuntu系统怎么用git新增分支并且提交?

以上就是Ubuntu系统用git新增分支并且提交的方法,希望大家喜欢,请继续关注。

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

相关侵权、举报、投诉及建议等,请发 E-mail:qiongdian@foxmail.com

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部