Android Studio上的“提交”窗口显示“文件.git / config中错误的配置行12”

时间:2019-01-27 08:10:54

标签: git android-studio git-config

我最近将我的github存储库从公共切换为私有。这样,新的提交就“通过了”,但是没有出现在仓库中。相反,“在Github上打开”时出现404错误。我意识到这可能是因为我的标签仅限于“ HEAD”和“ master”,而缺少“ origin / master”。这就是我尝试过的:

git init
git checkout -B master origin/master
fatal: 'origin/master' is not a commit and a branch 'master' cannot be created from it

我回到我的Android Studio项目,它说“ .git / config文件中错误的配置行12”,这就是我怀疑是问题所在(在记事本中):

[remote "origin"] //line 8
url = https://github.com/user/applicationname.git //not the actual url, but I know this line is fine
fetch = +refs/heads/*:refs/remotes/origin/*[branch "master"]  

remote = origin //line 12
merge = refs/heads/master

其中remote = origin是第12行。我还仔细检查了目录:

git rev-parse --git-dir
.git

我在公开场合推了几次。而且我仍然可以通过“版本控制:日志”打开以前的提交页面。

1 个答案:

答案 0 :(得分:0)

仍然看起来您在import java.util.Random; import java.util.Scanner; public class GuessingGame { public static void main(String[] args) { Scanner scan = new Scanner(System.in); Random generator = new Random(); int MIN = 0; int MAX = 100; int answer; int guess; String another = "y"; boolean flag = false; boolean anotherFlag = true; while(anotherFlag){ answer = generator.nextInt(MAX) + 1; System.out.println("I'm thinkin of a number between 0 and " + MAX ); System.out.println("Can you guess what it is? \n"); flag = false; while(!flag) { guess = scan.nextInt(); if(guess == answer){ System.out.println("You guessed correctly"); flag = true; } else{ System.out.println("That was wrong, try again."); } } System.out.println("Want to Play again?(y/n)"); another = scan.next(); if(another.equalsIgnoreCase("y") == true){ anotherFlag = true; } else{ anotherFlag = false; } } 之前缺少换行符。如果没有它,您似乎正在尝试为[branch "master"]设置一个remote,我想您不能这样做。括号中的内容应该开始一个新的部分,但是由于缺少换行符,因此它是在[remote]设置的值(该值应该是前一行)的基础上进行修改。

fetch =