Notes on git
来源:互联网 发布:c 语言标准函数库速查 编辑:程序博客网 时间:2024/06/04 17:51
Git 使用记录
初次使用Github托管代码,作如下记录备忘。
说明:这里只针对windows下的使用,其他系统的使用请另行搜索。
使用记录,从头开始:
注册github账户,并进行账户信息配置。
在电脑上安装客户端(这里选择msysgit)。
为了将代码托管到远端github,需要先在电脑上安装git客户端,这里选用msysgit。
配置git,保证连接。
在本地创建ssh key:
$ ssh-keygen -t rsa -C "your_email@youremail.com"
在github账户中添加ssh key
在本地创建完ssh key后,在提示的路径中打开ssh key 的pub文件,复制ssh key到 account setting里的ssh keys –> add shh key。
验证,在git bash 里输入:
$ ssh -T git@github.com
git config
打开git bash,输入:
$ git config --global user.name "your name"$ git config --global user.email "your_email@youremail.com"
托管代码。
在github上新建一个仓库repository,并复制到本地
$ git clone http://github.com/ruilog/test(你的repo地址)
代码托管
将要托管的代码(如:NASA文件夹)复制到test文件夹下,打开git bash,在本地的仓库文件夹中(test)重新初始化现存的Git版本库:
$ git init
建立跟踪:
$ git add 'NASA'
提交创建:
$ git commit -m 'NASA'
建立连接:
$ git remote add origin http://github.com/ruilog/test.git
开始上传:
$ git push origin master
当本地已有仓库时,在仓库目录右键git bash,上传:
git push --mirror http://git.oschina.net/ruilog/repo
done!
0 0
- Notes on git
- NOTES ON GIT PRO CH1 GETTING STARTED
- git-Notes
- GIT Notes
- Git Notes
- Notes on Nationalism
- Notes on the Way
- notes on rpmbuild
- SAP Notes on HPUX
- Notes on MongoDB
- Again, Notes on Alignment
- Notes on deduplication
- Notes on MongoDB
- Notes On Stable Fluids
- Notes on Cryptography
- Notes on Supermodel
- Several notes on Redis
- Notes on Python
- 关于Maven启动项目时总是下载POM的问题
- HttpClient4.5教程-第四章-HTTP身份认证
- 算法_动态规划_最少硬币问题
- [IO]——节点流
- clientOptions属性详解
- Notes on git
- git stash和git stash pop
- mysql主从备份功能配置与测试
- 在幼儿园管理系统中使用BootStrap的时候,如何快速找到合适的图标!
- 一种夸域名web单点登录设计思路
- hdu 1039 Easier Done Than Said?
- 京东2016实习生招聘 C++开发工程师 在线考试(编程题第二题:选举游戏)
- 取悦生活还是取悦自己
- 《C++编程思想》第二章习题