[英]Commit window on Android Studio says “bad config line 12 in file .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
在公開場合我推了幾次。 而且我仍然可以通過Version Control:Log打開先前提交的網頁。
仍然看起來您在[branch "master"]
之前缺少換行符。 沒有它,您似乎正在嘗試為[remote]
設置一個remote
[remote]
,我想您不能這樣做。 括號中的內容應該開始一個新的部分,但是由於缺少換行符,因此它使fetch =
設置的值裝反了,該值應該是前一行。
[remote "origin"]
url = https://github.com/user/applicationname.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.