• git命令设置


    初始化为git项目:

    cd .../project  //切换到项目目录下

    git init  //把project初始化为git项目

    git remote add origin https://gitee.com/name/project.git  //设置远程项目地址

    git remote set-url origin https://gitee.com/name/project.git  //修改远程项目地址

    首次把项目上传到git上。

    1.清空git上的项目。因为上面有个README.md文件

    2.使用上面的初始化为git项目命令后再上传

    //克隆远程项目到当前目录下:

    git clone https://gitee.com/name/project.git

    设置全局用户属性

    git config --global user.name "xxx"

    git config --global user.email "xxx@xx.com"

    设置局部项目用户属性,需要先切换到项目目录下 //如果没设置局部项目的用户属性则默认使用全局的用户属性

    git config user.name "xxx"

    git config user.email "xxx@xx.com"

    根据上面可以发现,设置全局则需要在config后增加 --global,设置局部项目则不需要加

    设置全局的git长期存储账号密码,如果不设置的话则每次与远程进行交互时都需要输入账号密码

    git config --global credential.helper store

    也可以设置账号密码有效时间(默认为15分钟)

    git config --global credential.helper cache

    自定义有效时间,设置有效时间为一小时
    git config --global credential.helper cache 'cache --timeout=3600'

  • 相关阅读:
    Class attributes
    Card objects
    Exercises
    Type-base dispatch
    Operator overloading
    The str method
    loadrunner协议开发
    nmon分析与详解
    如何判断CPU、内存、磁盘的性能瓶颈?
    用友NC客户端地址
  • 原文地址:https://www.cnblogs.com/Johnson-lin/p/9044491.html
Copyright © 2020-2023  润新知