git的一些基本命令总结
来源:互联网 发布:模拟人生要网络嘛 编辑:程序博客网 时间:2024/05/21 05:42
最近刚刚开始使用Git,对于所有的一些命令以及环境都不是很熟,这里个人总结一下。
1.git的安装和初次使用配置
ubuntu安装git下直接命令
sudo apt-get install git
git一般和repo一起使用,所以需要配置repo
#you can rename the dir according to your habitsmkdir [devDir] && cd [devDir]#--------------------------------------------------------#references: https://source.android.com/source/downloading.html#install repo #you can change the dir but you must ensure the dir is included in your PATHmkdir ~/binPATH=~/bin:$PATH#Download Repo and ensure it is executable#make sure the dir the same as beforecurl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repochmod a+x ~/bin/repo
初次使用git需要配置user.name以及user.email
#First time must set user.name and user.emailgit config user.name "[username]"git config user.email [username@example.com]
初始化repo,也就是通过ssh与相应的git服务其建立链接
#initialize repo repo init -u ssh://[url].git
最后一部同步代码
#until now you can Sync codes from the gitrepo sync
至此相应的开发代码已经同步到对应的目录[devDir]下。
注:以上命令中,带有"[ ]"的都是需要根据实际情况替换的。
2.开发过程中使用git的一般流程
同步代码,前面已经说过;
创建分支
git branch [branch] --track origin/[branch]
关联分支
git branch [branch] --set-upstream origin/[branch]
查看分支状态
git branch
切换到[branch]分支
git checkout master
将修改完毕的code加入到暂存区
git add .
查看当前暂存区状态
git status
将暂存区的修改提交到本地库
git commit -s -m "comment"
repo upload .
慢慢熟练,不断完善中~~~~~~~加油!!!!
0 0
- git的一些基本命令总结
- git 基本的一些命令
- 关于git的一些基本使用命令
- 第一次使用git的一些基本命令
- Git 命令的一些基本用法
- Git最基本的一些命令
- git基本命令总结
- Git基本命令总结
- 【总结】基本的git使用命令
- 关于git的基本命令总结
- git常用的一些命令总结
- 关于git的一些命令总结
- 一些常用git基本命令
- Git的安装到一些基本的命令
- Git Heroku 基本命令总结
- git 基本命令使用总结
- git的基本命令
- Git基本的命令
- JQueryUI Datepicker组件设置日期高亮
- Head First Python (中文)学习笔记-第5章
- 第十周项目6:贪财的富翁(结果待解决
- Unity优化内存笔记
- [容斥原理] hdu 1695 GCD
- git的一些基本命令总结
- Java系列-如何读取.properties属性文件
- cocos2d-x 之 简单数据存储——Userdefault
- Debug与Release版本区别
- Unity协程(Coroutine)管理类——TaskManager工具分享
- 字符串的全排列
- 线性分类Linear Classification
- 二进制 模拟 codeforces 485C
- Multi-linear classification(MLP)多层神经网络基础原理