Closed lorenzznerol closed 4 years ago
Why are you trying to stage an entire git repository inside another repository?
The main reason for this is a mistake, I am still a clear biginner at git, even after a couple of tutorials and quite a few first applications. The reason here is that I have cloned the repo from github into a folder that I had mistakenly initialized as repo right before cloning. I stayed in that parent folder into that I had cloned. After cloning, the structure was like "vscode_git\vscode-java\" and I still was in the "vscode_git\" directory, though the actual project was the "vscode-java\" directory. Now I found that I could not effectively add and commit a file, as it was then a file of the subdirectory "vscode-java\". The only way to see the files in the staging was to add all in one, using git add .
/ git add -A
/ git add --all
. This was nothing I wanted to do, it was more during testing of some code from a tutorial, of course adding all is wrong. I have finally understood my mistake, the pull request from a forked clone and from the actual project folder is done now.
This question here is only about the cut message text. It is not that important anymore what I actually wanted to do here? One might avoid the cut of the message, and one might add a hint in these cases like "Please check if you are in the right git directory, you might be in a parent or sub directory." or something like that of course. If I am not mistaken again here.
Got it. We try our best to forward git's messages to the user, but sometimes git itself wrongly formats the message, making it really hard. That's why the Open Git Log
button is there, so you actually get to see the entire message. Closing this as designed.
I understand it is a formatting issue of git, but this is not entirely true. They simply insert a linebreak here to have a better output in the git log, which is nothing impossible to track. vscode will probably have this again elsewhere, that is why I would rather not close this "as designed". To a new user, it is also not even clear that she can look at the git log to see the full error message, though it may seem clear to a professional.
Version: 1.47.0 (user setup) Commit: d5e9aa0227e057a60c82568bf31c04730dc15dcd Date: 2020-07-09T08:01:16.801Z Electron: 7.3.2 Chrome: 78.0.3904.130 Node.js: 12.8.1 V8: 7.8.279.23-electron.0 OS: Windows_NT ia32 10.0.18363
Steps to Reproduce:
(I could not reproduce this, probably it has only occured due to a renaming of parent folder, the error message is cut anaway)
git init
(or use the Source Control button "Initialize Repository") and use for example:git clone "https://github.com/redhat-developer/vscode-java.git"
git add --all
> the whole folder is added to the stage.cut error message "Git: the following file has staged content different from both the":
press open git log, in the log we see now the uncut error message at the bottom.
Does this issue occur when all extensions are disabled?: Untested, but no of course, as the error refers to git in the message, thus the error only occurs when using git, which is built-in. Git version 2.27.0