新建立了一个远程仓库,想着把项目放上去.于是在项目目录上: git init 然后就添加远程库 git remote add origin xxxx.git 然后就想push: git push -u origin master 结果提示错误: error:src refspec master does not match any 百度下,原来是说我本地没有提交任何东西,本地版本库为空, 空目录不能提交 (只进行了init, 没有add和commit). 解决: 添加:git add -A 提交…
问题场景:新建git项目或刚为已存在项目创建了git仓库,想用git branch dev创建dev分支或用git checkout -b dev创建并切换到dev分支时报错. 原因:刚创建的git仓库默认的master分支要在第一次commit之后才会真正建立,否则就像你声明了个对象但没初始化一样 解决办法:先git add .添加所有项目文件到本地仓库缓存,再git commit -m "init commit"提交到本地仓库,之后就可以随心所欲地创建或切换分支了.(这里给出的是可…
错误描述: error: object file .git/objects/9a/83e9c5b3d697d12a2e315e1777ceaf27ea1bab is empty fatal: loose object 9a83e9c5b3d697d12a2e315e1777ceaf27ea1bab (stored in .git/objects/9a/83e9c5b3d697d12a2e315e1777ceaf27ea1bab) is corrupt 解决方法: $ rm -fr .git $…
情景再现 远程新建仓库,然后本地 git bash执行以下代码 git init git add . git commit -m 'xxx' git remote add origin https://username@xxx.com/xxx.git git push 在执行git push的时候出现" The current branch master has no upstream branch."问题的原因是没有将本地的分支与远程仓库的分支进行关联,如图  对应的中文意思: fa…
git push到远程仓库时提示:fatal: The current branch master2 has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin master2,如图: 大意是当前分支与远程分支没有建立关联,提示运行  git push --set-upstream origin master2 与远程仓库…
网上多半都是命令行下的解决方案,我用的是EGit,所以要在eclipse里(我的版本是kepler)把下面这句话添加到配置文件中. Window->Preference->Team->Git->Configuration->Repository Settings->选择你的repository,然后点open [branch "master"] remote = origin merge = refs/heads/master…
eclipse git 一个错误:the current branch is not configured for pull No value for key branch.xxx.merge found in configuration : 这是由于 在用gui创建分支的时候 config文件没有创建branch 在config文件加上 [branch "xxx"] remote = origin merge = refs/heads/xxx 您可以…
1.在本地工程目录找到config文件(我的是在D:\git\demo\.git):2.修改config文件内容为: [core] repositoryformatversion = 0 filemode = false bare = false logallrefupdates = true symlinks = false ignorecase = true hideDotFiles = dotGitOnly [remote "origin"] url = https://gith…
网上多半都是命令行下的解决方案,我用的是EGit,所以要在eclipse里(我的版本是kepler)把下面这句话添加到配置文件中. Window->Preference->Team->Git->Configuration->Repository Settings->选择你的repository,然后点open [branch "master"]  remote = origin  merge = refs/heads/master 第二种 1.在本地…
使用Git Pull项目的时候出现这个问题: The current branch is not configured for pull No value for key branch.master.merge found in configur 查看config配置都正常,但是pull的时候就是提示上面的错误 查看eclipse git配置发现没有把merge加载上 重新编辑把[branch]位置提前往上放了一下,重新pull的时候就OK了…