Git的基本命令及其他—笔记
来源:互联网 发布:linux怎么卸载jenkins 编辑:程序博客网 时间:2024/05/20 05:26
- git add 添加修改
- git commit 提交修改
- git pull 从远程更新本地代码
- git push 从本地更新远程代码
- git reset 撤回提交
- git branch 分支
- git checkout 切换分支
- git log
- git tag
- 删除远程的分支和本地的分支
- git的基本设置
git add 添加修改
git add . 添加所有修改
git add -u 添加修改过的部分(不包含untracked的)
git add -i 互动添加模式
git commit 提交修改
git commit -m {commit message} 单行提交
git commit - -amend 编辑上一次的commit信息
git pull 从远程更新本地代码
git pull origin master 从远程端口origin的master分支更新到本地
git push 从本地更新远程代码
git push origin master 更新到远程端口origin的master分支上
git push remote {yourbranch:master} 更新到你的分支到remote的master上
git reset 撤回提交
git reset 放弃add,但保留修改
git reset - -hard 放弃所有修改,回到上一次commit的状态
git reset - -hard HEAD 回到最新一次commit的状态
git reset - -hard HEAD^ 回到前一个commit的版本
git reset - -hard HEAD^^ 回到前两次的commit版本
git reset - -hard HEAD~2 回到前三的commit的版本
git reset - -soft HEAD 回到commit提交前的状态
git branch 分支
git branch 列出所有分支
git branch {new-branch} 在此branch上建新的branch
git branch {new-branch} master 从master上建新的branch
git branch push -u origin {new-branch} 建立远端branch
git branch -a 显示所有branch (包含remote)
git push origin :branch 删除远端的branch
git checkout 切换分支
git checkout {branch-name} 切换到branch-name分支
git checkout master 切换到master
git checkout -b {new-branch} master 从master上建立新的分支
git checkout -b {new-local-branch-name} origin/{branch-name} 建立来自remote的分支
git checkout - - {file-name} 放弃提交前的修改
git log
git log 将列出所有的log
git log - -graph - -oneline - -all 展出提交示意图
git tag
git tag -l 列出所有的tag
git tag -a {tag-name} -m “tag-message” 在目前的HEAD建立tag-name的tag,并建立tag-messagede的信息
git tag {tag-name} commit-id 再commit-id的HEAD, 建立tag-name的tag
删除远程的分支和本地的分支
git branch origin delete {the-remote-branch}
git branch -d {the-local-branch}
git的基本设置
生成sshkey:
ssh-keygen -t rsa -C “email_address”
git的配置:
git config - -global user.name “your_name”
git config - -global user.email “your_email_address”
2
- Git的基本命令及其他—笔记
- 二叉树的基本应用及其他
- Git 笔记——基本命令
- Linux命令—压缩及其他
- Git基本命令学习笔记
- git的基本命令
- Git基本的命令
- Git的基本命令
- git的基本命令
- git的基本命令
- linux学习笔记之shell介绍及其他命令
- Android的基本世界观——系统简介,组件逻辑及其他
- Android的基本世界观——系统简介,组件逻辑及其他
- 服务端开发,基本的框架结构图(SSH及其他)
- Git学习笔记—基本命令及用法
- 切换用户命令及其他
- MySQL数据库的导入与导出,及其他相关命令
- git 的基本命令用法
- OpenCV中的meanStdDev函数
- 运算符优先级
- Java中常用String类的方法
- Java trouble shooting
- 安装python2和3之后geany软件的配置
- Git的基本命令及其他—笔记
- Java之static的用法
- 根据逗号,提取前2段字符串
- opencv学习——canny边缘检测
- 【MVC】获取项目中所有的控制器-试图
- 数组的遍历方法
- 基于Strassen算法采用分治的矩阵乘法cpp实现
- 欢迎使用CSDN-markdown编辑器
- 2.ROS串口控制