Git提交到github上
1、本地创建一个目录redis
[guosong@etch171 mars171 redis]# pwd
/data1/guosong/code/redis
[guosong@etch171 mars171 redis]# ll
total 12
drwxr-xr-x 2 guosong guosong 4096 Oct 24 01:09 list_20141023
drwxr-xr-x 2 guosong guosong 4096 Oct 23 00:36 sds_20141021
drwxr-xr-x 2 guosong guosong 4096 Oct 23 23:13 sds_20141022
2、生成git初始化仓库
git init
产生.git目录
[guosong@etch171 mars171 .git]# more config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
3、配置用户名和邮箱
git config --global user.name "sguo421"
git config --global user.email "sguo421@gmail.com"
.git/config文件发生变化
[guosong@etch171 mars171 redis]# more .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "github"]
url = https://github.com/sguo421
fetch = +refs/heads/*:refs/remotes/github/*
4、github配置ssh-keys
避免提交的时候输入用户名和密码

5、创建一个repository
否则提示出错
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly
6、提交代码
git add list_20141023/
git add sds_2014102* git commit -m "learning redis source code step by step" #使用ssh远程提交模式
#git remote add origin git@github.com:youusername/test.git git remote add origin git@github.com:sguo421/redis.git
git push -u origin master
[参考资料]
https://github.com/peterluo/LearningPythonDiary/blob/master/1.How%20to%20use%20git.md
Git提交到github上的更多相关文章
- 本地项目文件通过git提交到GitHub上
		参考:https://blog.csdn.net/kongying19910218/article/details/50515834 步骤: 1.初始化git,假如我们要提交test文件夹下的所有目录 ... 
- 记录Android Studio项目提交到github上的出错处理
		首先是按照网上的教程进行了一次提交,具体见http://web.gxzj.com.cn/News.aspx?id=325505 记得当时出现过这个错误Can't connect to reposito ... 
- 使用Windows下的git工具往github上传代码 踩坑记录
		使用Windows下的git工具往github上传代码 踩坑记录 背景 由于以前接触的项目都是通过svn进行版本控制,现在公司项目使用git,加上自己平时有一个练手小项目,趁着周末试着把项目上传到自己 ... 
- 通过git shell 在Github上传本地项目
		首先现在github上新建一个库,再进行如下操作,过程不赘述 1.打开git shell 2.cd到项目位置 // cd archives-vue 3.git init 4.Get add ... 
- GitHub学习二-将本地Git库与Github上的Git库相关联
		0 git clone 如果是从自己的github clone,一键搞定,和三步的git remote add功能一样. 1.创建本地库 新建目录,右键git bash here,输入 git ini ... 
- 使用git工具删除github上的文件或者文件夹
		解决 使用git工具删除github上的文件或者文件夹 当我们需要从github上删除一些我们不需要的文件或者文件夹时,如果通过github来操作的话,将会很麻烦,因为github只允许删除一个仓库, ... 
- 将本地已经存在的非git项目提交到github上的空仓库
		一.本地项目执行操作 1.在本地项目目录下初始化git仓库 git init 2.将本地项目下工作区的所有文件添加到git版本库的暂存区中 git add . (可以创建.gitignore文件忽略不 ... 
- 如何通过Git命令行把代码提交到github上
		1.http://www.cnblogs.com/leesf456/p/5169765.html 参考博客 背景:最近入手了mac,看见mac上的大神都是在用git命令行推代码,我很羡慕有木有,好 ... 
- 使用git提交到github,每次都要输入用户名和密码的解决方法
		使用git提交文件到github,每次都要输入用户名和密码,操作起来很麻烦,以下方法可解决,记录以下. 原因:在clone 项目的时候,使用了 https方式,而不是ssh方式. 默认clone 方式 ... 
随机推荐
- ZOJ2212 Argus 优先队列 结构体
			#include <iostream> #include <string> #include <queue> using namespace std; struct ... 
- asp.net中使用Global.asax文件中添加应用出错代码,写入系统日志文件或数据库
			void Application_Error(object sender, EventArgs e) { // 在出现未处理的错误时运行的代码 Exception objErr = Server.Ge ... 
- 深入Javascript之this
			前言 近期准备好好的读一读<你不知道的JavaScript(上卷)>这本书,俗话说的好,好记性不如烂笔头,读到this这章感觉是时候需要一些笔记了.文中如有错误之处,欢迎指出. 什么是th ... 
- Tomcat 笔记-配置域名
			编辑/etc/hosts文件,添加域名: 127.0.0.1 localhost 127.0.1.1 ubuntu # The following lines are desirable for IP ... 
- 快速部署Telegraf & Influxdb
			是什么? Telegraf 是一个用 Go 编写的代理程序,可收集系统和服务的统计数据,并写入到 InfluxDB 数据库.Telegraf 具有内存占用小的特点,通过插件系统开发人员可轻松添加支持其 ... 
- 史上最简单的MySQL安装教程之Linux(CentOS6.8)下安装MySQL5.6
			一.准备 安装包:Percona-Server-5.6.21-70.0-r688-el6-x86_64-bundle.tar MySQL下载地址:http://www.percona.com/doc/ ... 
- inline的C99标准相关原文
			WG14/N1256 Annex J (informative) Portability issues J.1 Unspecified behavior Whether a call to an in ... 
- c++ 类的默认八种函数
			c++ 类的默认八种函数 #define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <string> #incl ... 
- Tempter of the Bone
			Problem Description The doggie found a bone in an ancient maze, which fascinated him a lot. However, ... 
- Very Simple Problem
			Very Simple Problem Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u ... 
