zoukankan      html  css  js  c++  java
  • git常用命令总结

    • 查看客户端用户名邮箱
    git config user.name
    git config user.email
    
    • 修改用户名密码
    git config --global user.name "leida"
    git config --global user.email "leida@bjfu.edu.cn"
    
    • 创建仓库后初始化
    echo "###" >> README.md
    git init
    git add README.md
    git commit -m "first commit"
    git remote add origin https:....
    git push -u origin master
    
    • git clone之后会自动建立remote
    • 同一行文本被不同分支修改过,才会有冲突,只有一个人修改,则不存在冲突,会直接覆盖
    git push -u origin dev
    
    • 表示将当前分支推送到远程dev分支上,-u表示建立关联,之后就只需要git push 就行
    • 出现refuseing to merge unrelated histories,按如下解决
    git pull origin master --allow-unrelated-histories
    
    • 关联远程分支
    git push --set-upstream origin hexo
    
    • 本地项目跟远程项目初次合并
    git init
    git add .
    git commit -m "first commit"
    git remote add origin https:....
    git pull origin master --allow-unrelated-histories
    # pull过程中合并两个分支,之后解决冲突
    # 注意清理缓存重新提交,不然ignore可能会失效
    git rm -r --cache .
    git add .
    git commit -m "first commit"
    git push
    
    • 忽略已经提交的文件
    git rm -r --cached xxx   //xxx表示不再想版本控制的文件,然后在  .gitignore 文件中加入该忽略的文件 
    git add .
    git commit -m 'update .gitignore'
    
  • 相关阅读:
    elk6.3 centos集群搭建 head插件安装
    10.2半群,同余关系,半群直积,商半群
    10.1代数结构
    9.4 关系的闭包
    9.5 等价关系
    9.6偏序关系
    9.3 关系的表示
    9.1 关系及关系性质
    差分数组
    拓扑排序
  • 原文地址:https://www.cnblogs.com/buptleida/p/12090022.html
Copyright © 2011-2022 走看看