I have been pressing "No", but GitHub Desktop still lists it as being staged and ready to be committed. My partner, him, uses the Command Prompt and not GitHub Desktop, and has been pressing "Yes" and reports the same behaviour (the file gets committed).
So what exactly does this prompted message do ?
NOTE: We both use IntelliJ, which is the application prompting us this message.
EDIT: Adding the screenshot below for clarity. The green item is the result of me selecting 'YES' on the prompt, and the red item is the result of me selecting 'NO' on the prompt. We can see they both are presented in the GitHub Desktop application anyways. The question is thus: what does this prompt do?
EDIT: Current set up:
IntelliJ IDEA 2018.1 (Community Edition) Build #IC-181.4203.550, built on March 26, 2018 JRE: 1.8.0_152-release-1136-b20 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Windows 10 10.0
GitHub Desktop 1.2.6
EDIT: Now updated IntelliJ to latest version:
IntelliJ IDEA 2018.1.6 (Community Edition) Build #IC-181.5540.7, built on July 11, 2018 JRE: 1.8.0_152-release-1136-b39 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Windows 10 10.0
Here is a screenshot of the gitstatus
(but both files still get listed in GitHub Desktop as being ready to be committed) :
In order to see the exact command IntelliJ IDEA executes you can go to View > Tool Windows > Version Control (Alt + 9). In that view, you select the Console tab. See image below:
Once there you can see what it does exactly by adding a new file (Right click in project folder > New > Java Class). Let's call it "MyFile.java".
When the confirmation prompt shows up, if:
Yes is selected, the following command is shown in console:
14:48:46.853: [valuedemo] git -c core.quotepath=false -c log.showSignature=false add --ignore-errors -- src/main/java/com/lealceldeiro/valuedemo/MyFile.java
The relevant part here is git -c core.quotepath=false -c log.showSignature=false add --ignore-errors -- src/main/java/com/lealceldeiro/valuedemo/MyFile.java
, which basically adds the file "MyFile.java" with the core#quotepath and log#showSignature values to false and ignoring any error.
If you have any doubts about the state of the files you can use git status
and if there is a file you do not want to commit you can use git rm
. Actually if we want to remove our previously added "MyFile.java" through the IDEA UI, we can do Right click on the file > Git > Revert > Revert and it will print in VCS console git -c core.quotepath=false -c log.showSignature=false rm --cached -f -- src/main/java/com/lealceldeiro/valuedemo/MyFile.java
See more about:
git -c
Tested with IntelliJ IDEA 2018.1.5 (Ultimate Edition), Build #IU-181.5281.24, built on June 12, 2018.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With