Git使用教程
来源:互联网 发布:java await notifyall 编辑:程序博客网 时间:2024/06/15 05:55
首先下载git客户端程序,我下载的是Git-1.8.3-preview20130601.exe,安装后,执行Git Bash,这时你需要设置根据提示设置email和name,然后就可以创建自己的代码库了。
1、当前项目未执行初始化请执行下面操作
在本地创建新的Git仓库(连接别人的代码和创建自己的代码库)
mkdir andbase
cd andbase
git init
touch README.md
git add README.md
git commit -m 'hello world'
git remote add origin https://code.jd.com/zhaoqp2010_m/andbase.git
将主分支修改推送到服务器
git push -u origin master
下载主分支数据
git pull -u origin master
连接本地已有的 Git 仓库
git remote add origin https://code.jd.com/zhaoqp2010_m/andbase.git
git push -u origin master
2、提交代码
进入存放你所要提交代码的文件夹下
git add .
git commit -m 'hello world'
git push -u origin yourbranch
3、下载分支代码
git pull -u origin yourbranch
4、查看Git仓库中的文件状态
git status
5、向服务器的Git仓库中提交本地Git仓库已修改的文件或目录
git push -u origin yourbranch
6、下载服务器端Git仓库中的文件或目录到本地当前目录。
git clone https://code.jd.com/zhaoqp2010_m/andbase.git
7、查看所有分支
git branch -a
8、建立newbranch分支
git checkout -b newbranch
9、切换到master分支
git checkout yourbranch
10、提交所有修改
git commit -a
11、合并分支
先 git checkout newbranch 切换到newbranch分支
再 git merge newbranch/master
12、将主分支修改推送到服务器
git push origin master
13、将newbranch分支修改推送到服务器
git push origin newbranch
- git使用教程,命令教程
- Git使用教程
- git 使用教程
- Git使用简明教程
- <<git使用快速教程>>
- Git 使用教程
- git 使用教程
- Git初级使用教程
- git@osc使用教程
- Git初级使用教程
- Git 使用教程
- <<git使用快速教程>>
- Git使用教程
- git简单使用教程
- Git 使用教程
- Git使用教程
- Git使用教程
- Git初级使用教程
- Opencv学习笔记(背景更新---目标跟踪)
- 去除jsp执行后,网页源码中的空行
- Could not instantiate bean class [org.springframework.web.multipart.MultipartFile]: Specified class
- WebService学习笔记(二)服务端Demo
- JSP自定义标签扩展----支持EL,访问Spring容器
- Git使用教程
- Linux战地日记——历史命令
- jQuery 将网页中一个表格中的数据已行为最小单元添加到另外的一个表格当中
- 初识 Spring 框架,进入Spring的世界
- [企业管理]到了移动互联网泡沫破裂的时候了
- 如何判断程序是x86还是x64类型
- 笔记---多页面控制 (不定时更新)
- OPENCV——直方图计算calcHist
- 位域