前往小程序,Get更优阅读体验!
立即前往
发布
社区首页 >专栏 >git基本命令

git基本命令

原创
作者头像
coffee1
修改2024-10-26 15:32:29
修改2024-10-26 15:32:29
1120
举报

git初始化

git init

git拉取代码

git clone https://www.google.com/index.git

git拉取某一个分支

git clone -b feature/123 https://www.google.com/index.git

git上传文件

git status

git add cypress/e2e/1.spec.ts

添加所有文件,使用 git add .

git commit -m "feat: 添加测试用例"

git pull

git push

git只上传指定文件

git status

git add cypress/e2e/1.spec.ts cypress/e2e/2.spec.ts cypress/e2e/3.spec.ts

git stash -u -k

git commit -m "feat: 上传测试用例"

git pull

git push

git stash pop

git删除文件

git add .

git rm cypress/1.cy.ts cypress/2.cy.ts cypress/3.cy.ts

git commit -m "fix: 删除cypress目录.cy.ts文件"

git push

git查看所有分支

git branch -a

git创建新分支并切换到新分支

git checkout -b origin/dev

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档