Git 命令 从一个Git库复制到另一个Git库设置混乱的处理办法

 

今天git一个项目到远程库,不出意外就是创建一个本地仓库,然后把代码添加到本地仓库 提交到本地仓库。 然后关联到远程仓库地址,最后push 到master,一点毛病没有。

 

但是我之前这个文件夹写了别的项目没删,本地git乱设置了,然后我直接把这个项目copy到一个文件夹,最后一大堆错误,且看看把:

 

 git add .的时候直接报错

是因为复制的没有被git检测到,然后我就强制清了一下缓存区的东西,并且重新改了一下配置,然后再Add就成功

 

 

 

 

 

 

 

最后再关联一下远程库,最后再push到master

 

复制在这:

CNZHAJ@CN5CD123J48V MINGW64 /e/ZhaoXi/AppRun/Advanced.Common
$ git status
fatal: not a git repository (or any of the parent directories): .git

CNZHAJ@CN5CD123J48V MINGW64 /e/ZhaoXi/AppRun/Advanced.Common
$ git init
Initialized empty Git repository in E:/ZhaoXi/AppRun/Advanced.Common/.git/

CNZHAJ@CN5CD123J48V MINGW64 /e/ZhaoXi/AppRun/Advanced.Common (master)
$ git add .

CNZHAJ@CN5CD123J48V MINGW64 /e/ZhaoXi/AppRun/Advanced.Common (master)
$ git commit -m"初始化"
[master (root-commit) b2fd807] 初始化
28 files changed, 1216 insertions(+)
create mode 100644 Advanced.Common.csproj
create mode 100644 ExcelDataResource.cs
create mode 100644 ExcelOperationHelper.cs
create mode 100644 TitleAttribute.cs
create mode 100644 bin/Debug/Advanced.Common.1.0.0.nupkg
create mode 100644 bin/Debug/net5.0/Advanced.Common.deps.json
create mode 100644 bin/Debug/net5.0/Advanced.Common.dll
create mode 100644 bin/Debug/net5.0/Advanced.Common.pdb
create mode 100644 bin/Debug/net5.0/NOTICE.TXT
create mode 100644 bin/Debug/net5.0/ref/Advanced.Common.dll
create mode 100644 nuget.exe
create mode 100644 obj/Advanced.Common.csproj.nuget.dgspec.json
create mode 100644 obj/Advanced.Common.csproj.nuget.g.props
create mode 100644 obj/Advanced.Common.csproj.nuget.g.targets
create mode 100644 obj/Debug/Advanced.Common.1.0.0.nuspec
create mode 100644 obj/Debug/net5.0/.NETCoreApp,Version=v5.0.AssemblyAttributes.cs
create mode 100644 obj/Debug/net5.0/Advanced.Common.AssemblyInfo.cs
create mode 100644 obj/Debug/net5.0/Advanced.Common.AssemblyInfoInputs.cache
create mode 100644 obj/Debug/net5.0/Advanced.Common.GeneratedMSBuildEditorConfig.editorconfig
create mode 100644 obj/Debug/net5.0/Advanced.Common.assets.cache
create mode 100644 obj/Debug/net5.0/Advanced.Common.csproj.AssemblyReference.cache
create mode 100644 obj/Debug/net5.0/Advanced.Common.csproj.CoreCompileInputs.cache
create mode 100644 obj/Debug/net5.0/Advanced.Common.csproj.FileListAbsolute.txt
create mode 100644 obj/Debug/net5.0/Advanced.Common.dll
create mode 100644 obj/Debug/net5.0/Advanced.Common.pdb
create mode 100644 obj/Debug/net5.0/ref/Advanced.Common.dll
create mode 100644 obj/project.assets.json
create mode 100644 obj/project.nuget.cache

CNZHAJ@CN5CD123J48V MINGW64 /e/ZhaoXi/AppRun/Advanced.Common (master)
$ git remote add origin https://github.com/zhaJinWu/ExcelDemo

CNZHAJ@CN5CD123J48V MINGW64 /e/ZhaoXi/AppRun/Advanced.Common (master)
$ git push -u origin master
Enumerating objects: 34, done.
Counting objects: 100% (34/34), done.
Delta compression using up to 12 threads
Compressing objects: 100% (29/29), done.
Writing objects: 100% (34/34), 2.08 MiB | 1.11 MiB/s, done.
Total 34 (delta 3), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (3/3), done.
remote:
remote: Create a pull request for 'master' on GitHub by visiting:
remote: https://github.com/zhaJinWu/ExcelDemo/pull/new/master
remote:
To https://github.com/zhaJinWu/ExcelDemo
* [new branch] master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.

 

posted @ 2022-05-13 23:27  Jeffrey是个瘦子  阅读(544)  评论(0)    收藏  举报