{"id":21,"date":"2023-01-26T01:21:51","date_gmt":"2023-01-26T01:21:51","guid":{"rendered":"https:\/\/blogs.oregonstate.edu\/keechblog\/?p=21"},"modified":"2023-01-26T01:35:33","modified_gmt":"2023-01-26T01:35:33","slug":"git-adventures","status":"publish","type":"post","link":"https:\/\/blogs.oregonstate.edu\/keechblog\/2023\/01\/26\/git-adventures\/","title":{"rendered":"Git Adventures"},"content":{"rendered":"\n<p>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.<\/p>\n\n\n\n<p>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&#8217;ll be using Docker. In my experience using Docker on Windows can be a bit of a hassle, and it&#8217;s as simple as can be on Linux.<\/p>\n\n\n\n<p>The flaw in my plan was that I don&#8217;t have any GUI for interacting with GitHub, so I needed to do it from the command line. That&#8217;s fine as far as I&#8217;m concerned, I do half of my Gitting from the command line anyway.<\/p>\n\n\n\n<p>It did not go well.<\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<p>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&#8217;d done. I had something usable by the time I had to start work. I only needed to push it&#8230;<\/p>\n\n\n\n<p>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&#8217;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.<\/p>\n\n\n\n<p>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&#8217;t doubt that it will be less fun when I have to spend several nights stuck on one problem that seems tiny.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":13101,"featured_media":26,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-21","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.oregonstate.edu\/keechblog\/wp-json\/wp\/v2\/posts\/21","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.oregonstate.edu\/keechblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.oregonstate.edu\/keechblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/keechblog\/wp-json\/wp\/v2\/users\/13101"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/keechblog\/wp-json\/wp\/v2\/comments?post=21"}],"version-history":[{"count":2,"href":"https:\/\/blogs.oregonstate.edu\/keechblog\/wp-json\/wp\/v2\/posts\/21\/revisions"}],"predecessor-version":[{"id":25,"href":"https:\/\/blogs.oregonstate.edu\/keechblog\/wp-json\/wp\/v2\/posts\/21\/revisions\/25"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/keechblog\/wp-json\/wp\/v2\/media\/26"}],"wp:attachment":[{"href":"https:\/\/blogs.oregonstate.edu\/keechblog\/wp-json\/wp\/v2\/media?parent=21"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/keechblog\/wp-json\/wp\/v2\/categories?post=21"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/keechblog\/wp-json\/wp\/v2\/tags?post=21"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}