git常用命令

  1. 克隆项目
php 复制代码
 git clone [email protected]:project/test.git
复制代码
2. 创建新分支
php 复制代码
//新建 fenzhi 分支
git checkout -b fenzhi
  1. 查看当前所有的分支
php 复制代码
 git branch -a
  1. 从当前master切换到fenzhi 分支上
php 复制代码
  git checkout online
  1. 此时可以查看分支,使用git branch即可看到master和 fenzhi 分支
php 复制代码
 git branch
  1. 删除 fenzhi 分支
php 复制代码
  git branch -d online
  1. 在 fenzhi分支上提交的代码到master上
php 复制代码
//分支fenzhi 提交数据到master
  git status
  git add .
  git commit -m '编辑器添加水印'
  git push origin fenzhi
  git checkout master
  git pull origin master
  git merge hd_mlib
  git push origin master
  git checkout fenzhi
  git status
  git merge master
  git status
  history
相关推荐
貂蝉空大42 分钟前
Git Switch 与 Git Restore 详解
git
aini_lovee9 小时前
python在容器内克隆拉取git私有仓库
git·python·elasticsearch
zhangphil9 小时前
git merge合并分支push报错:Your branch is ahead of ‘xxx‘ by xx commits.
git
2018_XWJ9 小时前
本地项目push到git
git
漫步企鹅10 小时前
【Git】面对发布或重要节点,Git如何打Tag?
git·tag·节点·发布
能工智人小辰10 小时前
learngitbranching git游戏笔记
git
牧野星辰20 小时前
.gitignore文件的规范
git·github
二个半engineer1 天前
GitLab Web 界面创建分支后pathspec ... did not match any file(s)
git·gitlab
尽兴-1 天前
Git 清理指南:如何从版本库中移除误提交的文件(保留本地文件)
大数据·git·gitee·gitlab
飞翔的猪猪2 天前
GitHub Recovery Codes - 用于 GitHub Two-factor authentication (2FA) 凭据丢失时登录账号
前端·git·github