git工具使用
来源:互联网 发布:淘宝网图标图片大全 编辑:程序博客网 时间:2024/05/29 18:37
1.从github克隆代码,在本地使用:
git clone http://github.com/Weltch/helloworld.git
2.拉取github代码到本地修改,并提交(第一次建立git仓库);
a) 新建空目录tmp;
b) cd tmp;
c) 建立git仓库,git init;
d) 拉取远程代码: git pull http://github.com/Weltch/helloworld.git
e) 添加文件:git add 文件名或文件名
f) 确认提交: git commit -m “注释说明”
g) 向github添加分支:git remote add origin http://github.com/Weltch/helloworld.git
(提示:如果报错fatal: remote origin already exists,则先删掉origin分支,再提交。删除分支:git remote rm origin)
h) 提交分支到远程仓库:git push -u origin master
3. 更新代码(已经建立git仓库);
a)首先确定git仓库是否最新,拉取一遍:git pull即可;
b) 添加修改过的文件: git add 文件
c) 确认提交:git commit -m “add 文件”
d) 直接提交到远程仓库:git push -u origin master
4. 添加新分支到远程仓库
a) 在本地创建并切换到新分支:git checkout -b newbranch;
b) 将修改后的文件添加到该分支,git add *; git commit -m “*”;
c) 查看远程有没有newbranch分支:git branch -r;
d) 如果没有则提交到远程git仓库:git push origin newbranch;这时在远程就会生成newbranch的分支;
- git 工具使用
- git工具的使用
- linux git工具使用
- Git工具使用
- Git工具使用
- git工具命令使用
- git工具的使用
- git工具使用
- Git工具的使用
- git 工具GitEye使用
- git工具的使用
- Git工具使用备忘
- git工具使用
- git使用--可视化工具
- 【工具】git 使用
- Git工具的使用
- 使用Git命令行工具
- 工具使用:git
- EMR、EHR和PHR的定义与对比
- poj3641
- 类加载
- 非行内元素与行内元素转换的几种方法
- 今天在学习C语言循环时遇到的问题
- git工具使用
- 成为优秀程序员的十条黄金法则
- Eclipse打开Package Explorer
- centos7/rhel7设置笔记本触摸版
- 最短路径floyd算法
- 关于iwpriv :no private ioctls 的问题
- Android之LayoutParams的用法
- POJ 2253 —— Frogger
- java 8 默认方法和多继承