Git安装

系统:Ubuntu  

1,安装配置

查看是否安装            git

安装 

 sudo apt-get install git                      

创建进入目录git     

       mkdir  git 

  cd git/

2,创建仓库        

git init

创建文件                     

touch demo.txt

3,添加到暂存区       git add [file] 

git add demo.txt

4,提交到当前分支         

git commit -m "add file"            //“add file”为提交描述        

 

遇到问题

*** Please tell me who you are.
Run

  git config --global user.email "you@example.com"

  git config --global user.name "Your Name"

to set your account's default identity.

Omit --global to set the identity only in this repository

解决方法

设置邮箱用户名

git config --global user.email "you@example.com"  // you@example.com  换成自己的邮箱

git config --global user.name "Your Name"      //  Your name  换成自己的名字

git config --list  可查看配置列表  姓名和邮箱的配置文件保存在 .gitconfig 文件中

 4,查看状态

git status 

 

posted @ 2017-11-28 20:45  HY韩羽  阅读(115)  评论(0编辑  收藏  举报