git代码版本管理
2014-03-24 10:24
483 查看
1. Set Up Git
2. Create A Repo
Make a new repository on GitHub
Click New Repository
Create a README for your repository
Step 1: Create the README file
Step 2: Commit your README
Step 3: Push your commit
附:
参考:
官网:https://help.github.com/articles/set-up-git
其他链接:http://rogerdudler.github.io/git-guide/index.zh.html
因为经常把工作带回家去做,在家用电脑上写的一些代码常常来不及与公司电脑上的代码进行同步,导致代码管理混乱。
现在使用git来进行源代码管理,就轻松多了,而且还可以很方便地和别人一起协作开发。
1. 将PC-1上现有的Hello-World进行git管理并上传到服务器端:
cd ~/Hello-World
git init
git add *
git commit -m 'initial commit'
git remote add origin https://github.com/username/Hello-World.git
git push origin master #将本地的代码上传到服务器端
cd Hello-World
i) add new file
touch newfile #创建一个新文件来做测试
git add newfile
git commit -m 'add newfile'
git push origin master #将本地的代码上传到服务器端
ii) modify file
# modify the files, then
git checkout
git add <file>
git commit -m 'modify the file'
git push origin master
3.在PC-1上获取PC-2更新的内容:
git pull origin master #将服务器端的代码下载到本地
$ git config --global user.name "Your Name Here" $ git config --global user.email "your_email@example.com" $ git config --global credential.helper cache # timeout=900 by default $ git config --global credential.helper 'cache --timeout=3600'
2. Create A Repo
Make a new repository on GitHub
Click New Repository
Create a README for your repository
Step 1: Create the README file
$ mkdir ~/Hello-World $ cd ~/Hello-World $ git init $ touch README
Step 2: Commit your README
$ git add README $ git commit -m 'first commit(your description)'
# git add <filename> # git add <folder> # git add -u # 只加修改过的文件,不加入新增文件 # git add -i # 进入交互模式i # git rm <filename> # git mv <filename> <newfilename> # git mv <folder> <newfolder>
Step 3: Push your commit
$ git remote add origin https://github.com/username/Hello-World.git $ git push origin master
附:
error: RPC failed; result=56, HTTP code = 0
refer here
$ git config http.postBuffer 524288000
参考:
官网:https://help.github.com/articles/set-up-git
其他链接:http://rogerdudler.github.io/git-guide/index.zh.html
因为经常把工作带回家去做,在家用电脑上写的一些代码常常来不及与公司电脑上的代码进行同步,导致代码管理混乱。
现在使用git来进行源代码管理,就轻松多了,而且还可以很方便地和别人一起协作开发。
1. 将PC-1上现有的Hello-World进行git管理并上传到服务器端:
cd ~/Hello-World
git init
git add *
git commit -m 'initial commit'
git remote add origin https://github.com/username/Hello-World.git
git push origin master #将本地的代码上传到服务器端
2. 从服务器端检出版本库到PC-2,在PC-2上新建文件并上传到服务器端:
git clonehttps://github.com/username/Hello-World.git Hello-Worldcd Hello-World
i) add new file
touch newfile #创建一个新文件来做测试
git add newfile
git commit -m 'add newfile'
git push origin master #将本地的代码上传到服务器端
ii) modify file
# modify the files, then
git checkout
git add <file>
git commit -m 'modify the file'
git push origin master
3.在PC-1上获取PC-2更新的内容:
git pull origin master #将服务器端的代码下载到本地
相关文章推荐
- git撤销commit,错误reset后恢复本地代码;git忽略已经被纳入版本管理的文件
- 百度云网盘 360云盘 金山快盘 等 + Git GUI 实现代码版本管理-个人篇
- 利用网盘 + Git GUI 实现代码版本管理-个人篇
- 如何使用Git管理本地代码版本
- Git代码版本管理
- Git连接oschina管理代码版本
- iOS Git代码管理-对重大更新版本做标定,注tag
- 代码版本管理-Git学习笔记(1)
- Hybrid App开发git多分支代码版本管理实践
- 【代码管理】GitHub超详细图文攻略 - Git客户端下载安装 GitHub提交修改源码工作流程 Git分支 标签 过滤 Git版本工作流
- 基于git的代码版本管理规范及流程-简版
- 利用git管理代码版本, 并且和服务器同步
- 【代码管理】GitHub超详细图文攻略 - Git客户端下载安装 GitHub提交修改源码工作流程 Git分支 标签 过滤 Git版本工作流
- Git 代码版本管理的基本使用命令和步骤
- 百度云网盘 360云盘 金山快盘 等 + Git GUI 实现代码版本管理-个人篇
- 【转】Git连接oschina管理代码版本
- git的版本管理使用(三)-拉取分支代码
- git代码版本管理
- 代码版本管理软件Git的优势和用法