git初始化操作

Git本地用法:
[html] view plain copy
  1. 1.安装git sudo apt-get install git  
  2. 2.创建文件夹用git init创建本地仓库  
  3. 3.找到Config配置个人信息 并添加编写文件  
  4. 4.git status查看文件状态  
  5. 5.工作区添加到暂存区 git add . 或 git add 文件名  
  6. 6.暂存区提交到仓库区 git commit -m ‘版本描述’  
  7. 7.查看历史 git log 或 git reflog  
Git创建远程仓库:

[html] view plain copy
  1. 1.登录远程仓库创建立项  
  2. 2.克隆项目到本地 git clone https:xxx  
  3. 3.推送到远程仓库 git add . --》git commit -m ‘立项’ --》git push  
设置push有效期:
[html] view plain copy
  1. 设置记住密码(默认15分钟):  
  2. git config --global credential.helper cache  
  3. 如果想自己设置时间,可以这样做(1小时后失效):  
  4. git config credential.helper 'cache --timeout=3600'  
  5. 长期存储密码:  
  6. git config --global credential.helper store  

猜你喜欢

转载自blog.csdn.net/xhg_wandering_soul/article/details/80787123