首页 > 其他分享 >git如何把本地文件夹和远程仓库关联

git如何把本地文件夹和远程仓库关联

时间:2023-02-14 10:35:24浏览次数:36  
标签:origin git 仓库 add repoxx 文件夹 本地 远程

场景:
1,有一个本地项目,没有上传到git过,你在远程新建了一个仓库,想把这个本地的代码推送到该仓库
2,直接想把本地代码推送到远程并创建该本地文件对应的仓库

解决方法:

没有仓库:
mkdir repoxx
cd repoxx
git init 
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin [email protected]:xxYourName/repoxx.git
git push -u origin "master"

已有仓库?
cd existing_git_repo
git remote add origin [email protected]:xxYourName/repoxx.git
git push -u origin "master"

标签:origin,git,仓库,add,repoxx,文件夹,本地,远程
From: https://www.cnblogs.com/bigjor/p/17118820.html

相关文章

  • git bash窗口创建vue项目, 箭头切换没起作用?
    1、解决方法:一、直接在命令窗口创建(Win+R),输入cmd二、使用winpty命令+.cmd,如:winptynpm.cmdcreatevite@latest  ......
  • git命令
    gitremote-v查看本地仓库与哪些远程仓库建立了链接gitremoteaddupstreamhttps://github.com/timo1160139211/firstGit.git添加一个链接,连接名为upstream,链接......
  • git删除远程分支
    git删除远程分支gitpushorigin--delete[branch_name]删除本地分支区别gitbranch-d会在删除前检查merge状态(其与上游分支或者与head)。gitbranch-D是gitbranch-......
  • Git运用 一 (Gitee版)
     1.Git本地命令     先创建一个本地仓库     右键GitBashHere             查看git版本git--version  公共配置添加用......
  • Git运用 二 (Gitee版)
               清屏clear                   清屏clear              清屏clear......
  • Git运用 三 (Gitee版)
    创建分支:gitbranch[分支名称]  gitbranch b1查看分支: gitbranch-v 切换分支:gitcheckoutb1给分支添加内容:gitaddget_tong.txt gitcommit-m"b1bra......
  • Git运用——远程仓库操作(Gitee版)
    创建SSH安全秘钥    在gitee中查看ssh公钥  查看Gitee是否链接: [email protected]创建gitee仓库 创建远程仓库下载文件夹second_git_reposTest.java ......
  • Git添加项目出现的问题(Gitee版)-----Everything up-to-date
         解决方法: $gitadd.$gitcommit-m"message"$gitpushhttps://gitee.com/adderg/txc.git......
  • Git运用------仓库地址管理(Gitee版)
    进行远程操控仓库都有哪些:$gitremote-v添加远程仓库别名:gitremoteaddmy_tonghttps://gitee.com/adderg/txc.git 删除远程仓库别名: gitremoteremovemy_tong......
  • Linux远程工具FinalShell
    FinalShell是一体化的的服务器,网络管理软件,不仅是ssh客户端,还是功能强大的开发,运维工具,充分满足开发,运维需求.特色功能:云端同步,免费海外服务器远程桌面加速,ssh加......