Git 常用指令
2016-04-09 14:52
190 查看
设置用户名和邮箱
git config - -global user.email “tony@gmail.com”
git config - -global user.name “Tony”
创建git库
git init
未add之前,撤销当前所有修改
git checkout .
创建一个branch到另一个已有commit
git branch branchname sha1-of-commit
创建一个branch到当前commit
git branch branchname head
查看操作历史
git reflog
删除分支
git branch -d “branchName”
查看所有分支
git branch -a
创建分支
git branch “branchName”
回到特定分支
git checkout “branchName”
提交
git commit -m “commitName”
git remote add命令用于添加远程主机。
git remote add <主机名> <网址>
git remote add PC-AndroidWithSocket https://github.com/MichaleChang/PC-AndroidWithSocket.git
git push命令用于将本地分支的更新,推送到远程主机。
git push <远程主机名> <本地分支名>:<远程分支名>
git remote命令列出所有远程主机
git remote
参看远程主机的网址
git remote -v
克隆版本库的时候,所使用的远程主机自动被Git命名为origin。如果想用其他的主机名,需要用git clone命令的-o选项指定
git clone -o jQuery https://github.com/jquery/jquery.git
git remote rm命令用于删除远程主机
git remote rm <主机名>
git remote rename命令用于远程主机的改名
git remote rename <原主机名> <新主机名>
git config - -global user.email “tony@gmail.com”
git config - -global user.name “Tony”
创建git库
git init
未add之前,撤销当前所有修改
git checkout .
创建一个branch到另一个已有commit
git branch branchname sha1-of-commit
创建一个branch到当前commit
git branch branchname head
查看操作历史
git reflog
删除分支
git branch -d “branchName”
查看所有分支
git branch -a
创建分支
git branch “branchName”
回到特定分支
git checkout “branchName”
提交
git commit -m “commitName”
git remote add命令用于添加远程主机。
git remote add <主机名> <网址>
git remote add PC-AndroidWithSocket https://github.com/MichaleChang/PC-AndroidWithSocket.git
git push命令用于将本地分支的更新,推送到远程主机。
git push <远程主机名> <本地分支名>:<远程分支名>
git remote命令列出所有远程主机
git remote
参看远程主机的网址
git remote -v
克隆版本库的时候,所使用的远程主机自动被Git命名为origin。如果想用其他的主机名,需要用git clone命令的-o选项指定
git clone -o jQuery https://github.com/jquery/jquery.git
git remote rm命令用于删除远程主机
git remote rm <主机名>
git remote rename命令用于远程主机的改名
git remote rename <原主机名> <新主机名>
相关文章推荐
- 【Python笔记】图片处理库PIL的源代码安装步骤
- MsysGit下GUI乱码问题解决
- 深入理解javascript原型和闭包系列 深入理解javascript原型和闭包(16)——补this
- Python 练习实例4
- Android Studio 1.5 配置AndroidAnnotations
- js 截取或者替换字符串中的数字
- 大型网站系统架构的演化【转】
- 对结对作业的总结与体会
- 设计模式之观察者模式浅析
- 网易笔试题 路灯
- 关于在maven项目下,从一个jsp页面通过重定向跳转到另一个jsp页面时出现404的错误的解决方法
- 深入理解javascript原型和闭包系列 深入理解javascript原型和闭包(15)——闭包
- CCF-201509-3 模板生成系统
- 关于Java是强类型语言的相关解释
- 文本格式化
- Qt中让子窗体不继承副窗体的方法
- View.INVISIBLE和View.GONE的区别
- python-MySQL学习笔记-第一章链接到并创建数据库
- 个人项目框架搭建 -- 仓储模式使用
- 边框属性,背景属性,渐变