Git 常用命令行
Git设置:
-- Gitlab 公司账号 git config --global user.name "***" git config --global user.email "g**@nan**.com" -- Github 个人账号 git config --local user.name 'githubname' git config --local user.email 'github邮箱'
创建一个新仓库(Github 为例)
git clone gitlab@120.**.**.122:sk/report.git cd report git switch -c master touch README.md git add README.md git commit -m "add README" git push -u origin master
推送现有文件夹(Github 为例)
cd existing_folder git init --initial-branch=master git remote add origin gitlab@120.**.**.122:sk/report.git git add . git commit -m "Initial commit" git push -u origin master
推送现有的Git仓库(Github 为例)
cd existing_repo git remote rename origin old-origin git remote add origin gitlab@120.**.**.122:sk/report.git git push -u origin --all git push -u origin --tags