KISS πŸ‡ΊπŸ‡¦

Stop the war!

Stop the war in Ukraine! Fuck putin!

More information is at: https://war.ukraine.ua/.

There is a fund to support the Ukrainian Army: https://savelife.in.ua/en/donate/, and there is a special bank account that accepts funds in multiple currencies: https://bank.gov.ua/en/about/support-the-armed-forces. I donated to them. Please donate if you can!

Killer putin

Killer putin. Source: politico.eu.

Arrested putin

"It hasn't happened yet, but it will happen sooner or later. Beautiful photo, isn't it?" Source: twitter.

Can't reset file in git

| comments

Have you ever seen a file that git can’t reset/checkout? I have.

Here’s an example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$ git status -sb
## master
 M TCPData.java

$ git reset --hard
HEAD is now at 1234567 Some commit

$ git status -sb
## master
 M TcpData.java

$ git checkout -- TcpData.java

$ git status -sb
## master
 M TcpData.java

It turned out the file was renamed in one of the branches TcpData.java => TCPData.java, and after the latest merge here is the mess. This is observed on OS X. By the way:

1
2
$ ls
TCPData.java

Here the file is with capital letters. git stores the filenames as is (case-sensitive) while the default option on the OS X’s HFS+ filesystem is case-insensitive filenames. So you have to deal with that:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
$ git mv TCPData.java 1.java

$ git status -sb
## master
R  TCPData.java -> 1.java
 D TcpData.java

$ git rm TcpData.java
rm 'TcpData.java'

$ git status -sb
## master
R  TCPData.java -> 1.java
D  TcpData.java

$ git mv 1.java TCPData.java

$ git status -sb
## master
D  TcpData.java

Ha, it’s quite a twist. The git output suggests that git just removed the TcpData.java file from the current tree, which stops the mess.

Comments