GIT配置及常用命令
2015-12-13 01:56
483 查看
GIT下载地址: http://msysgit.github.com/
GIT配置:
Git 全局设置:
git config --global user.name "username"
git config --global user.email "youemail"
创建 git 仓库:
mkdir EX623
cd EX623
git init
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin https://{youusername}:{youpasswd}@git.oschina.net/wanggs/EX623.git git push -u origin master
已有项目
cd existing_git_repo
git remote add origin https://git.oschina.net/wanggs/bpoms.git git push -u origin master
修改master目录下.git目录下的config文件(添加如下内容)
[branch "master"]
remote = origin
merge = refs/heads/master
GIT支持中文
编辑 C:\Git\etc\inputrc 文件中对应的行,查找以下2行,并修改其值,
原先:
set output-meta off
set convert-meta on
改为:
全选复制放进笔记
set output-meta on
set convert-meta off
git config --global i18n.commitencoding utf-8
git config --global i18n.logoutputencoding gbk
编辑 C:\Git\etc\profile 文件,添加如下一行:
export LESSCHARSET=utf-8
git config --global gui.encoding utf-8
GIT添加空文件夹:
在空文件夹里touch一个.gitignore文件。
GIT常用命令:
$git status
$git add filename
$git commit -am "commit msg"
$git push
$git remote
$git remote -v
GIT配置:
Git 全局设置:
git config --global user.name "username"
git config --global user.email "youemail"
创建 git 仓库:
mkdir EX623
cd EX623
git init
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin https://{youusername}:{youpasswd}@git.oschina.net/wanggs/EX623.git git push -u origin master
已有项目
cd existing_git_repo
git remote add origin https://git.oschina.net/wanggs/bpoms.git git push -u origin master
修改master目录下.git目录下的config文件(添加如下内容)
[branch "master"]
remote = origin
merge = refs/heads/master
GIT支持中文
编辑 C:\Git\etc\inputrc 文件中对应的行,查找以下2行,并修改其值,
原先:
set output-meta off
set convert-meta on
改为:
全选复制放进笔记
set output-meta on
set convert-meta off
git config --global i18n.commitencoding utf-8
git config --global i18n.logoutputencoding gbk
编辑 C:\Git\etc\profile 文件,添加如下一行:
export LESSCHARSET=utf-8
git config --global gui.encoding utf-8
GIT添加空文件夹:
在空文件夹里touch一个.gitignore文件。
GIT常用命令:
$git status
$git add filename
$git commit -am "commit msg"
$git push
$git remote
$git remote -v
相关文章推荐
- 【Deep learning vs BPL】思考:complex => simple => rich
- GMM-HMM语音识别模型 原理篇
- HDOJ 5595 GTW likes math 【二次函数】
- 【Beta阶段】第一次Scrum Meeting!
- 最短路的理解(续)
- hackthegame<第十关>
- HDOJ 5596 GTW likes gt 【思维 】
- 错误
- Unity 5新特性
- 十五大原理之零三--TCP/IP的三次握手和四次断开原理
- 沉浸式标题
- 信息安全系统设计基础第十四周学习总结
- centos6.5 64位 搭建FTP服务器
- phpunit测试学习 2 分类总结断言涉及哪些方面
- react-native源码分析系列二
- 扪心自问!15个IT技术人员必须思考的问题
- phpunit测试学习 1:一点简单的扼要有用的东西的总结 一点入门认识
- chrome快捷键,让开发更快捷:
- 开源协议比较:BSD、Apache、GLP、LGLP、MIT
- phpunit测试成功 phpunit测试实践代码