Sleep timer ended
⏪ 10s
⏩ 10s
2.3K views
4 months ago Documentary
A quick Git developer challenge: We make a few changes to a file, make two adds, and then commit. Everything looks simple, but the final result might catch you …
...more
18 Comments
V2. it is staged but v3 isn't
Obviously the correct answer v2
v2 - v3 never staged
Result: v2 Why: The second git add stages the file at v2. The final change to v3 is not staged.
V2 is added to LOCAL repo, not pushed 😅
v2 . Didn't add v3
As far as I am concerned. I just do vibe coding but just for the heck of it V3
V2
v3. Last add wins. Git snapshots what's staged at commit time. Classic gotcha.
V2 cause v3 has not been added before commit
It's V2 that gets committed because V2 was staged using "add" command before "commit" command was executed.
V2 for sure. V3 is in working directory and v2 is in staging area
Hint: Ask yourself: does git commit what is currently staged, or the history of how the file changed?
Damn! It is the most easy question 😅 Anything that isn't staged can't be commit. I feel shy 😂😂😂
V2. V3 not added before the commit.
B. v2<br>V3 is an unstaged (not added) change prior to the commit. Adding after v2 overwrites the staged change of v1 cuz the contents of config.txt changed
V2 because V3 has not been added
V3
18 Comments