Git本地仓库推送到别的仓库

1.新建空的GIT仓库

基本语法参考:

1.1创建一个新仓库
git clone ssh://git@192.168.101.85:9091/liskyingl/tyfuzhoumetronew.git
cd tyfuzhoumetronew
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master

1.2推送现有文件夹
cd existing_folder
git init
git remote add origin ssh://git@192.168.101.85:9091/liskyingl/tyfuzhoumetronew.git
git add .
git commit -m "Initial commit"
git push -u origin master

1.3推送现有的 Git 仓库
cd existing_repo
git remote rename origin old-origin
git remote add origin ssh://git@192.168.101.85:9091/liskyingl/tyfuzhoumetronew.git
git push -u origin --all
git push -u origin --tags

2.参照1.3操作

3.关联远程仓库

  git branch --set-upstream-to=origin/target-origin

4.移除远程仓库

  git remote rm target-origin

原文地址:https://www.cnblogs.com/oumi/p/12493798.html