this post was submitted on 14 Oct 2023
11 points (86.7% liked)

Programming

17496 readers
38 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 1 year ago
MODERATORS
11
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/programming
 

I'm doing a solo coding project for work. It's a tool that you interact with similar to npm or cargo, where you can create a new workspace, run / test etc. Importantly, you have to be in the working directory for the commands to work...

Yesterday I decided to go home early to do remote work at home. Before i left i quickly did git add ., committed and pushed. I turned on my computer this morning, ran git pull, and noticed that... only some files got pushed, but more importantly none of the code i wrote yesterday made it through. Yup, I was still cd'd into my workspace folder and not at the project root, so I only committed the mock workspace folder ๐Ÿ˜„

Luckily i didnt write or change much this time, but lesson learned: git add -A or git commit -am '...'

you are viewing a single comment's thread
view the rest of the comments
[โ€“] drew_belloc 11 points 1 year ago (2 children)

I always do a git status just to be sure before a commit

[โ€“] thtroyer 2 points 1 year ago (1 children)

Or use tig. It's a great CLI tool to view git status, stage/unstage, and view history. And I never really hear anyone talk about it.

[โ€“] drew_belloc 1 points 1 year ago

Thanks, i will take a look