git基础操作

1. 创建仓库
  • 终端cd到指定目录,使用git init ****创建仓库,创建之后会在目录中看到你刚创建的仓库,仓库中包括.git文件,如下所示

    git基础操作_第1张图片
    image.png

    git基础操作_第2张图片
    image.png

    如果不显示,可能是文件隐藏,使用command + shift + >显示隐藏文件

  • 给本地仓库添加远程地址
    pod remote add origin ***// 添加远程仓库路径

2. Clone仓库

cd到指定目录,终端执行git clone **(远程仓库路径),把仓库clone到本地

3. git修改用户名密码

重置用户名密码,输入命令git config --global credential.helper osxkeychain,再执行pod install、pod update就会要求重新输入用户名和密码了。
很多文章上面说使用git重置登录信息 git config --system --unset credential.helper,我试了一下,一直提示could not lock config file /etc/gitconfig: Permission denied,最后还是使用git config --global credential.helper osxkeychain解决的

你可能感兴趣的:(git基础操作)