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://[email protected]*****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://[email protected]*****i.com/wmcg/mall.git (fetch)

    origin ssh://[email protected]*****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://[email protected]*****i.com/~sunruize02/srz.git

    admindeMacBook-Pro:testGitError sunruize$ git remote -vv

    origin ssh://[email protected]*****i.com/~sunruize02/srz.git (fetch)

    origin ssh://[email protected]*****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 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.

你可能感兴趣的:(Git中遇到的问题)