Git中遇到的问题

问题简述:父文件夹与子文件夹跟踪的远程仓库地址不一致,导致的提交的问题

问题复现:

    1.首先创建一个新的文件夹

    2.从远程仓库下载mall项目

    admindeMacBook-Pro:~ sunruize$ mkdir testGitError

    admindeMacBook-Pro:~ sunruize$ cd testGitError/    

    admindeMacBook-Pro:testGitError sunruize$ ls

    admindeMacBook-Pro:testGitError sunruize$ git clone ssh://git@git.s*****i.com/wmcg/mall.git

    3.查看当前文件夹文件

    admindeMacBook-Pro:testGitError sunruize$ ls -a

    . .. mall

    4.查看mall文件夹下文件

    admindeMacBook-Pro:mall sunruize$ ls -a

    . .git lombok.config mall_service

    .. .gitignore mall_api pom.xml

    5.mall文件夹下文件跟踪的仓库

    admindeMacBook-Pro:mall sunruize$ git remote -vv

    origin ssh://git@git.s*****i.com/wmcg/mall.git (fetch)

    origin ssh://git@git.s*****i.com/wmcg/mall.git (push)

    6.在testGitError文件夹下初始化git

    admindeMacBook-Pro:mall sunruize$ cd ../

    admindeMacBook-Pro:testGitError sunruize$ ls

    mall

    admindeMacBook-Pro:testGitError sunruize$ git init

    Initialized empty Git repository in /Users/sunruize/testGitError/.git/

    7.查看跟踪的远程仓库

    admindeMacBook-Pro:testGitError sunruize$ git remote add origin     ssh://git@git.s*****i.com/~sunruize02/srz.git

    admindeMacBook-Pro:testGitError sunruize$ git remote -vv

    origin ssh://git@git.s*****i.com/~sunruize02/srz.git (fetch)

    origin ssh://git@git.s*****i.com/~sunruize02/srz.git (push)

    8.git add .

hint: You've added another git repository inside your current repository.

hint: Clones of the outer repository will not contain the contents of

hint: the embedded repository and will not know how to obtain it.

hint: If you meant to add a submodule, use:

hint:

hint: git submodule add <url> mall

hint:

hint: If you added this path by mistake, you can remove it from the

hint: index with:

hint:

hint: git rm --cached mall

hint:

hint: See "git help submodule" for more information.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 配置 首先是配置帐号信息 ssh -T git@github.com#登陆github 修改项目中的个人信息 1 ...
    rochuan阅读 751评论 1 1
  • 安装Git Git的下载地址:Git官网下载地址 Git本地仓库和命令 配置用户 下载完Git后,右键会有一个Gi...
    TokyoZ阅读 4,523评论 1 7
  • 1.git的安装 1.1 在Windows上安装Git msysgit是Windows版的Git,从https:/...
    落魂灬阅读 12,713评论 4 54
  • Git使用教程:https://blog.csdn.net/tgbus18990140382/article/de...
    SkTj阅读 2,822评论 1 11
  • Add & Commit git init 初始化一个 Git 仓库(repository),即把当前所在目录变成...
    冬絮阅读 4,906评论 0 9