git 添加到环境变量
github 新增仓库的后的提示
…or create a new repository on the command line echo "# top" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/liangkeno/top.git
git push -u origin master
…or push an existing repository from the command line git remote add origin https://github.com/liangkeno/top.git
git push -u origin master
…or import code from another repository
You can initialize this repository with code from a Subversion, Mercurial, or TFS project.
1,找到安装git的安装目录,C:\Program Files (x86)\Git\bin,win7在计算机属性中添加路径
2,使用命令行添加,set PATH=%PATH%;C:\Program Files (x86)\Git\bin
git 简明教程:http://rogerdudler.github.io/git-guide/index.zh.html
安装git的记录
1,配置git的全局参数,包括用户名,邮箱地址,生产SSH公密钥
1--,命令行设置用户名,邮箱
git config --global user.name "username"
git config --global user.email "username@email.com"
2,push.default参数主要是设置在执行push命令是的策略,主要的选项有以下几个:
- nothing : Do not push anything
- matching : Push all matching branches (default)
- tracking : Push the current branch to whatever it is tracking
- current : Push the current branch
这里我们手动设置成默认值:
git config --global push.default matching
3,生成SSH key,在开始菜单中找到git bash并运行
$ssh-keygen -t rsa -C "username@email.com"
此时会提示你输入存储key的文件名(我输入github),并提示你输入密码与确认密码(我这里选择不输入),接着会生成连个文件名一个是公钥与私钥文件并存储在C:\Users\***文件夹下:github,github.pub

config文件,防止链接出现错误,代码如下:
Host github.com
User git
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port
4,绑定本机git与github
1--,打开github.pub公钥文件,拷贝里面公钥文本
2--,登陆官网https://github.com/,创建账号,进入设置,在SSH and GPG keys设置公钥,
5,打开git bash,输入ssh git@github.com测试是否连接上github
显示如下信息即已经连接成功
$ ssh git@github.com
PTY allocation request failed on channel 0
Hi ****! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
5,到此,既可以使用本机上的git连接github上的repository了
使用git Bash 添加文件从本地到github仓库
1,第一次更新到仓库
1--,初始化本地仓库,
git init
2--,更新到版本库
$ git add *
//错误提示
warning: LF will be replaced by CRLF in package.json.
The file will have its original line endings in your working directory.
解决方法:
$ git config --global core.autocrlf false
//更新所有文件
$ git add . //更某个文件
$ git add 文件名 //更某个目录
$ git add 目录名/
此时只是把文件放置缓存区
3--,添加注释
$ git commit -m "相关说明"
4--,关联到远程仓库
$ git remote add origin git@github.com:yourname/yourgit.git
5--,推送到远程仓库
$ git push -u origin master
2,再次更新到仓库,使用 add>>commit>>push origin master 即可
git add .
error: filename too long
git config --global core.longpaths true
3,把远程更新到本地仓库
下载远程到本地 :git fetch origin master
合并远程到本地:git merge origin/master
git 添加到环境变量的更多相关文章
- 下载git2.2.1并将git添加到环境变量中
># wget https://github.com/git/git/archive/v2.2.1.tar.gz > # tar zxvf v2.2.1.tar.gz ># cd g ...
- vue-cli如何添加多种环境变量
vue-cli如何添加多种环境变量 目前webpack(vue-cli) 打包有两种变量,development, productor, 如何添加一个 test的测试环境呢 vue-cli 3.0 v ...
- linux下查看和添加PATH环境变量
linux下查看和添加PATH环境变量 $PATH:决定了shell将到哪些目录中寻找命令或程序,PATH的值是一系列目录,当您运行一个程序时,Linux在这些目录下进行搜寻编译链接. 编辑你的 PA ...
- Mac 可设置环境变量的位置、查看和添加PATH环境变量
Mac 启动加载文件位置(可设置环境变量) ------------------------------------------------------- (1)首先要知道你使用的Mac OS X是什 ...
- ***LINUX添加PHP环境变量:CentOS下将php和mysql命令加入到环境变量中
CentOS系统下如何将PHP和mysql命令加入到环境变量中,在Linux CentOS系统上 安装完php和MySQL后,为了使用方便,需要将php和mysql命令加到系统命令中,如果在没有添加到 ...
- Mac可设置环境变量的位置、查看和添加PATH环境变量
Mac 启动加载文件位置(可设置环境变量) 首先要知道你使用的 Mac OS X 是什么样的 Shell,使用命令 echo $SHELL 如果输出的是:csh 或者是 tcsh,那么你用的就是 C ...
- linux下添加PATH环境变量
添加PATH环境变量,第1种方法:[root@lx_web_s1 ~]# export PATH=/usr/local/webserver/mysql/bin:$PATH 再次查看: [root@lx ...
- Mac下添加java环境变量
2015年4月22号更新: 发现一个坑:最近发现有同事按照本文方式配置jdk环境变量一直不成功,后来发现他是使用了“Oh-My-Zsh”,配置文件的路径不是/etc/profile或~/.bash_p ...
- Linux 添加到环境变量
在Linux下使用源码安装软件的时候,通常只能在软件安装目录下使用该软件命令,这样太麻烦,我们希望全局使用,可以将软件安装路径添加到系统环境变量里. 添加环境变量有2种方法: 1. 使用export命 ...
随机推荐
- suse的安装命令zypper,类似apt
例子:添加11.3的官方软件和升级源zypper ar http://download.opensuse.org/distribution/11.3/repo/oss/ mainzypper ar h ...
- OSGI依赖问题处理
用osgi实现java的模块化和热插拔时要考虑好两个问题,不同bundle间如何通信?依赖怎么处理? OSGi的一个标准就是各个bundle之间是相互隔离的,每个bundle都有自己的classloa ...
- uva1084
状压dp+凸包 并没有看出来凸包的性质 首先答案一定在凸包上,然后每个凸包的角加起来是一个圆,那么就相当于凸包周长加一个圆了.然后预处理,再状压dp计算即可. #include<bits/std ...
- Coursera Algorithms week3 归并排序 练习测验: Counting inversions
题目原文: An inversion in an array a[] is a pair of entries a[i] and a[j] such that i<j but a[i]>a ...
- Coursera Algorithms Programming Assignment 2: Deque and Randomized Queue (100分)
作业原文:http://coursera.cs.princeton.edu/algs4/assignments/queues.html 这次作业与第一周作业相比,稍微简单一些.有三个编程练习:双端队列 ...
- Python入门 六、像个 Pythonista
pickle import pickle test_data = ['Save me!',123.456,True] f = file('test.data','w') pickle.dump(tes ...
- Arbitrage(floyd)
http://poj.org/problem?id=2240 #include <stdio.h> #include <string.h> <<; ][]; ][] ...
- 使用composer 实现自动加载
准备工作:提前安装好composer 1.创建项目目录OOP 2.OOP目录下新建composer.json文件,composer.json是一个空json文件,代码如下: { } 3.打开控制台,进 ...
- 查看Oracle数据库表空间大小,是否需要增加表空间的数据文件
在数据库管理中,磁盘空间不足是DBA都会遇到的问题,问题比较常见. --1查看表空间已经使用的百分比 Sql代码 select a.tablespace_name,a.bytes/1024/1024 ...
- 5、scala数组转换
1.使用yield和函数式编程转换数组 2.算法案例:移除第一个负数之后的所有负数 1.使用yield和函数式编程转换数组 使用yield进行数组转换 结合if守卫,仅转换需要转换的元素 使用函数式编 ...