git 常用操作
2016-01-10 21:03
267 查看
命令行
1. 从零开始
bitbucket.org网站登录后创建版本库
设置您的本地目录
Set up Git on your machine if you haven't already.
mkdir /path/to/your/project
cd /path/to/your/project
git init
git config --global user.name 'zhoushengchao'
git remote add origin https://zhoushengchao@bitbucket.org/zhoushengchao/h5canvas.git
创建你的第一个文件,提交,然后推送到仓库。
echo "shengchao zhou" >> contributors.txt
git add contributors.txt
git commit -m 'Initial commit with contributors'
git push -u origin master
干的漂亮,现在你已经完成所有安装步骤!开始编码吧或者创建一个团队并且邀请新人加入吧。
2. 有一个已经存在的项目
bitbucket.org已经有个一个版本仓库
本地创建一个新目录,拉取仓库上的最新版本到本地
cd /path/to/my/repo
git init
git config --global user.name 'zhoushengchao'
git remote add origin https://zhoushengchao@bitbucket.org/zhoushengchao/h5canvas.git
从远程获取最新版本到本地
git fetch origin master:tmp
git diff tmp
git merge tmp
从远程获取最新的版本到本地的tmp分支上 之后再进行比较合并
如果不想要temp分支了,可以删除此分支
git branch -d tmp
1. 从零开始
bitbucket.org网站登录后创建版本库
设置您的本地目录
Set up Git on your machine if you haven't already.
mkdir /path/to/your/project
cd /path/to/your/project
git init
git config --global user.name 'zhoushengchao'
git remote add origin https://zhoushengchao@bitbucket.org/zhoushengchao/h5canvas.git
创建你的第一个文件,提交,然后推送到仓库。
echo "shengchao zhou" >> contributors.txt
git add contributors.txt
git commit -m 'Initial commit with contributors'
git push -u origin master
干的漂亮,现在你已经完成所有安装步骤!开始编码吧或者创建一个团队并且邀请新人加入吧。
2. 有一个已经存在的项目
bitbucket.org已经有个一个版本仓库
本地创建一个新目录,拉取仓库上的最新版本到本地
cd /path/to/my/repo
git init
git config --global user.name 'zhoushengchao'
git remote add origin https://zhoushengchao@bitbucket.org/zhoushengchao/h5canvas.git
从远程获取最新版本到本地
git fetch origin master:tmp
git diff tmp
git merge tmp
从远程获取最新的版本到本地的tmp分支上 之后再进行比较合并
如果不想要temp分支了,可以删除此分支
git branch -d tmp
相关文章推荐
- MyBatis_整合ehcache
- 简易在线投票系统(php)——登录与注册
- BZOJ 2302: [HAOI2011]Problem c( dp )
- 介绍几款Web服务器性能压力测试工具
- 【POJ】3620 - Avoid The Lakes(dfs,水)
- 55.Bulb Switcher
- Python + Flask + Bootstarp 生成分析图表
- java中equal()与==的区别(顺便谈谈String,stringBuffer,StringBuilder)
- zzulioj--1769--去师院的旅程:能怎么走(三)(0.0)
- Global.asax实现URL重写
- 复选框(JCheckBox)
- zzulioj--1769--去师院的旅程:能怎么走(三)(0.0)
- linux学习(一)
- 唐人街探案 (2015)
- 主流浏览器内核介绍(前端开发值得了解的浏览器内核历史)
- LeetCode-- Valid Sudoku
- 自学考试-“信息资源管理”
- 欢迎使用CSDN-markdown编辑器
- 钱氏宗训
- 2016-01-10 FFC