目 录CONTENT

文章目录
Git

Git基础操作

Josue
2022-03-21 / 0 评论 / 0 点赞 / 145 阅读 / 539 字 / 正在检测是否收录...
温馨提示:
本文最后更新于 2022-03-26,若内容或图片失效,请留言反馈。部分素材来自网络,若不小心影响到您的利益,请联系我们删除。

Git操作

1、常用命令

# 1、初始化本地库
git init

# 2、查看本地库状态
git status

# 3、添加暂存区
git add 文件名<.指全部文件>

# 4、提交本地库,message表示提交信息
git commit -m "[message]" 

# 5、查看版本信息
git reflog #查看版本信息
git log # 查看版本详细信息

# 6、版本穿越
git reset --hard [版本号] #ca10ff4

2、分支操作

# 1、创建分支
git branch 分支名

# 2、查看分支
git branch -v 

# 3、修改分支

# 3、 切换分支
git checkout 分支名

# 4、合并分支
git merge 分支名

3、 团队协作

Seting ---> Manage access ---> invite a collaborator

# 起别名
git remote add 别名 仓库URL

# 1、拉取
git pull 别名 分支

# 2、推送
git push 别名 分支

# 3、克隆
git clone 仓库URL

4、跨团队协作

# 1、拉取
fork

# 2、推送
pull request

5、GitLab

免费开源的打码管理平台

官网:https://about.gitlab.com/

安装:https://about.gitlab.com/install/

0

评论区