Git常见命令总结
来源:互联网 发布:香港旅游 知乎 编辑:程序博客网 时间:2024/05/21 22:53
Git常见命令总结
Git配置
新建SSH公钥
$ ssh-keygen -t rsa -C "youremail@example.com"
配置用户名和邮箱
$ git config --global user.name "Your Name"$ git config --global user.email "youremail@example.com"
新建本地仓库
创建一个新的本地仓库
$ git init
本地修改操作
修改上次提交版本的信息
$ git commit --amend
分支管理
基于当前分支新建一个分支
$ git branch <branch>
基于当前分支新建一个分支并切换到新分支
$ git checkout -b <branch>
切换分支
$ git checkout <branch>
显示全部分支信息
$ git branch -av
删除分支
$ git branch -d <branch>
多人协作
从远程仓库克隆
$ git clone git@github.com:user_name/repo_name.git
查看远程仓库信息
$ git remote -v
添加远程仓库(比如添加原作者仓库)
$ git remote add <name> <url>
删除远程仓库
$ git remote remove <name>
重命名远程仓库
$ git remote rename <old> <new>
推送分支
$ git push origin <branch>
从远程抓取分支
$ git pull
获取远程仓库的分支和提交
$ git fetch <remote>
删除远程分支
$ git push origin --delete <branch>
阅读全文
0 0
- git常见命令总结
- Git常见命令总结
- git常见命令总结
- Git常见命令总结
- git常见的命令总结
- 【git】git常见命令
- git基本命令、pull的流程、以及常见错误总结
- Git 常见管理命令
- Git 常见命令
- git 命令常见用法
- git常见操作命令
- Git 常见命令用法
- git常见命令
- 常见的git命令
- git 常见命令
- GIT常见命令详解
- Git 常见命令
- git常见命令
- 脑弄大开之——如何抛弃数字和运算符号只用计算机和函数进行运算
- 自己动手写java 字节流输入输出流
- 内部类
- 二listview多条目加载
- Android--(2)--详解线性布局(LinearLayout)
- Git常见命令总结
- The study of calling fuction in Python(20170907)
- nefu 84 五指山(扩展ou'ji'li)
- 应用服务器的调优
- 求解斐波那契数列的第n个数
- LeetCode11. Container With Most Water
- 群赛5总结----2017.9.7
- 机房收费系统总览-全局篇
- Redux进阶系列3:如何设计action、reducer、selector