git global setup

  1. git config --global --edit // modify git config file
  2. or
  3. // config username and email
  4. git config --global user.name "scn4006"
  5. git config --glboal user.email "dongguang.zhu@saurer.com"
  6. // delete username and password
  7. git credential-manager uninstall
  8. git config --global credential.helper wincred
  9. ## Git store username and password
  10. git config --global --unset credential.helper // 删除用户名和密码
  11. git config --global credential.helper store

Create a new repository

  1. git clone git@172.16.34.200:root/spc.git
  2. cd spc
  3. touch README.md
  4. git add README.md
  5. git commit -m "add README"
  6. git push -u origin master

Push an existing folder

  1. cd existing_folder
  2. git init
  3. git remote add origin git@172.16.34.200:root/spc.git
  4. git add .
  5. git commit -m "Initial commit"
  6. git push -u origin master

Push an existing Git repository

  1. cd existing_repo
  2. git remote rename origin old-origin
  3. git remote add origin git@172.16.34.200:root/spc.git
  4. git push -u origin --all
  5. git push -u origin --tags