git init 说明

git start

  • git repository config
1
2
3
4
git init
git remote add origin https://xxx.xxx.xxx || git@git.xx.xxx
git config user.name xxx
git config user.email xxx

git 分支使用技巧

1
2
3
4
5
git branch -t demo origin/demo //创建demo分支 并且追踪远程demo分支
git branch --track demo origin/demo
$ git:(demo) git branch -u origin/master //修改demo远程追踪为master
$ git:(demo) git branch --set-upstream demo origin/master //不推荐

start description

  • git config 说明
    • remote add origin xxx 给本地仓库添加远程仓库 别名 origin
    • git 添加远程仓库https ssh 方式是不同的
    • ssh 需要通用 ssh key 的方式本地生成ssh key的公钥和私钥将公钥配置到gitserver。ex: github-setting-ssh key
    • https 每次push pull 都需要用户密码 用credential.helper 方式保存
      1
      2
      3
      4
      #window
      git config credential.helper=wincred
      #osx
      git config credential.helper=osxkeychain

— git 不同的登录方式ssh https 配置区别还是需要注意

装作特别有钱