Git Adventures

I have been using Bitbucket at work almost daily for the last year. I have been using GitHub for school and for the occasional personal project for longer than that. Last night I learned just how dependent I am on the graphic user interfaces available in those programs.

I have occasionally gotten in a jam on BitBucket, and usually when I did I came out with some useful knowledge that (almost?) made it worth it. I usually use tools native to IntelliJ when interacting with BitBucket, and have only had to resort to CLI commands beyond fetch, pull, and push when I had made a mess. At home I have usually used GitHub Desktop because it was simple and easy. When we started our project, however, I decided it would be more practical to use Linux because we’ll be using Docker. In my experience using Docker on Windows can be a bit of a hassle, and it’s as simple as can be on Linux.

The flaw in my plan was that I don’t have any GUI for interacting with GitHub, so I needed to do it from the command line. That’s fine as far as I’m concerned, I do half of my Gitting from the command line anyway.

It did not go well.

I made my first commit to our shared repo on Monday. I was up late and behind after spending a three-day weekend traveling with family (and without a computer). No problem, I went to bed late, got up early, and jumped right back into it after work on Tuesday.

I had not gotten as much done as I had hoped, but I at least had the scaffold for a front end, and I had sorted out the routing and most of the structure. It was time to figure out what I had done to commit to our repo. Evidently I did not figure that out and my problems kept getting worse. I managed to commit the entire node modules folder to our repo (despite being in .gitignore) without committing any of the other code. I never did figure out how I managed that. I kept making mistakes and after midnight I did a git pull from main, and overwrote all of my work. I went to bed discouraged.

I got up discouraged, too, but I was up early enough to put in an hour before work. I found a local copy of the work I had done on routing, and I could remember a lot of the other things I’d done. I had something usable by the time I had to start work. I only needed to push it…

It turned out that I had managed to get lost in my directories the night before, and the appearance of failed commits and un-functional software had to do with the fact that I had duplicated my work in a nested folder, i.e. frontend/frontend. I’d commit and push, but when I checked out the correct folder on GitHub, it had old code in it. This kept me confused as I got more and more tired. If I had stepped back and assessed my basic position, I may have solved it sooner.

Aside from the Git discomfort, I am thoroughly enjoying working on this project. At the moment everything is low-hanging fruit, and I can work on one thing until it looks useful and then move to another thing. I don’t doubt that it will be less fun when I have to spend several nights stuck on one problem that seems tiny.

Print Friendly, PDF & Email






Leave a Reply

Your email address will not be published. Required fields are marked *