Git 常用命令

BBigSun 评论318阅读模式

1、分支

  • master :主分支,每个仓库都有的分支
  • develop :功能开发分支
  • feature :小设计开发
  • hotfix :修复bug
  • release :测试分支

2、常用命令

查看 git 版本

git version

配置全局信息

git config --global user.name "Your name"
git config --global user.email "Your email"

初始化仓库

git init

克隆

git clone https://gitee.com/bbigsun/docsify-template.git

将工作区文件添加到暂存区

git add .

将暂存区文件提交道本地仓储区

git commit -m "提交代码"

查看文件状态

git status

查看分支

git branch

添加分支

git branch <branch_name>

删除分支

git branch -d <branch_name>

切换分支

git checkout <branch_name>

连接远程仓库

git remote add <shortname> <url>

将本地存储区更改提交到远程仓库

git push -u <short_name> <your_branch_name>

从远程仓库拉取代码到本地

git pull -u origin master
git pull --rebase
文章源自十年又十年-https://www.bbigsun.com/215.html

纸上得来终觉浅,绝知此事要躬行。

weinxin
17688689121
我的微信
微信扫一扫
BBigSun
  • 本文由 BBigSun 发表于 2023年 2月 7日 09:04:20
  • 转载请务必保留本文链接:https://www.bbigsun.com/215.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定