Git简明教程
2016-05-28 16:37
288 查看
创建仓库
mkdir /path/to/your/project cd /path/to/your/project git init git remote add origin https://xxxxx.git 创建你的第一个文件,提交,然后推送到仓库。 git config --global user.email "xx@xx.com" git config --global user.name "xxx" echo "bang li" >> contributors.txt git add contributors.txt git commit -m 'Initial commit with contributors' git push -u origin master
常用操作
查询状态git status
删除一个文件
git rm xxx
删除文件夹及其下所有的文件
git rm xxx -r -f
重命名
git mv fileA fileB
恢复文件的修改
git checkout -- ros_arduino_python/src/ros_arduino_python/arduino_driver.py
分支
查看分支git branch
切换分支
git checkout test
创建分支
git branch test1
上传分支
git push -u origin test1
下拉分支
git pull origin test1
忽略上传文件
在仓库的根目录下,新建.gitignore 文件,内用如下*~ *pyc *.swap # Object files *.o *.ko *.obj *.elf # Precompiled Headers *.gch *.pch # Libraries *.lib *.a *.la *.lo # Shared objects (inc. Windows DLLs) *.dll *.so *.so.* *.dylib # Executables *.exe *.out *.app *.i*86 *.x86_64 *.hex # Debug files *.dSYM/ *.su
相关文章推荐
- 深入理解js函数的作用域与this指向
- yum 在 rhel 6.x 下的本地配置
- 广义表
- POJ1062-昂贵的聘礼
- Bug分支
- Android菜单详解(二)——创建并响应选项菜单
- javaScript 工作必知(三) String .的方法从何而来?
- Linux下,解决LVM分区中unknown device的bug
- 练习三 1007
- Codeforces 464E The Classic Problem (线段树+哈希)
- 最小生成树-----Prim算法与Kruskal算法(未完
- linux中There are unfinished transactions remaining
- 揭开RecyclerView的神秘面纱(三):操作数据及添加分割线
- 《C Premer Plus(第五版)中文版》部分读书笔记
- js实现CkeckBox全选与反选
- HibernateTemplate 查询
- 总是找不到R文件 转义字符详解
- 1043. 输出PATest(20)
- 自定义View利用手势检测实现图片放大缩小
- java heap 和 stack 初识