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 '...'
omg these are great commands, thanks for sharing :)
git is definitely a weak spot for me in general, there's a lot of commands and similar commands, so my approach until now has been to forget they exist haha
Even better, just choose exactly which files to add to a commit, and keep the commits small and meaningful units of work! If you never use the shorthand, you won't have this issue, and your commit history will be easier to understand and expand upon!
I have been justifying it away though cause it's early stages of the project so it's hard to get my bearings. But the dust is starting to settle enough now that I can probably think about committing units of work rather than this daily snapshotting ive been doing
In my 20 year career, I’ve never had a single position where I could ssh into my work machine from a remote location.
I would say that if you have been able to do that, it’s exceptionally rare, and there are a number of security red flags of your organization is allowing that.