Lädt...


🔧 I watched "So You Think You Know Git" so you don't have to


Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to

Throughout my coding career so far, I've really only used a few git commands. My most frequent, can be found in the code block below.

git init
git pull
git clone
git add
git commit
git push
git log

And on occasion, I'll pull out a git rebase if I have to do something fancy or to fix a nerve-wracking mistake. So, I've made it my mission to get much more familiar with git and how git branches work when it comes to larger repos this month. It's also my first Hacktober so this is really more for me than it is for you. But if you're here and you're interested in what I have to say, than more power to you. I invite your curiosity and hope you can learn something new or brush up on an old fact lost over the years.

I recently watched Scott Chacon's FOSDEM 2024 talk, "So You Think You Know Git". He's one of the co-founders of GitHub, co-author of "Pro Git", and co-creator of Git Butler. The video was from 8 months ago, but in case it slipped your radar like it did mine, here are some personal highlights. I definitely encourage anyone reading to watch the full video, but if you're short on time, I've got you covered.

Conditional Configs

A fantastic feature of GitHub that allows you to work on personal or company projects with easy and flexibility. includeIf will allow you to assign what .gitconfig file is used for specific directories, letting you manage multiple git identities.

Two linkedif lines of code

Scott Chacon - FOSDEM 2024

Oldies But Goodies

Scott covers a few notable time-saving git commands that have been around for quite some time.

git maintenance

This command adds a cron job for git to run every hour and perform maintenance tasks on your repository. Since this is running in the background, it speeds up other git commands since they do not have to tack the processes onto other git commands and run as an afterthought. This helps to optimize git repository data.

--force-with-lease

git push --force-with-lease is recommended over git push --force as it is much safer. The command will check if someone has already pushed changes to the branch you're working on and will only allow your push if the branch has not diverged. If the branch has already changed, the push will be rejected which ensures that you will not accidentally overwrite someone else's work. This adds a layer of safety when you're working in collaborative environments.

Big Repo Changes

After Microsoft bought GitHub, many implementations were made to benefit monorepos or large repositories. The goal was to make working in with these large repositories faster and more streamlined.

prefetching

Similar to git maintenance, every hour the system will fetch references from the server for the project you're working on. It will not update references until the command git fetch is ran, but it makes this process faster because the data was already prefetched.)

partial cloning

Allows users to filter out blobs, an object type used to store contents of each file in a repo, and only fetch what you need. This makes the repo act almost like a file system, increasing the speed. One con of this feature is that it does not work with git blame.

commit-graph write

This command caches an index of all the commit objects so that it can do commit graph operations very fast. It is essentially a pre-computed graph that represents a commit history in a more efficient way because the larger a repo, the slower commit graph walks will be. This is because git needs to traverse through each commit to be able to answer any questions such as git log or git blame.

GitButler

The last section of Scott's talk was about his current project, GitButler, a git client that allows you to work on simultaneous branches. It utilizes a drag and drop feature that quickly organizes file changes to separate virtual branches. There also seems to be intuitive branch management features and could make working on multiple PR requests that much easier.

I have not personally used it, but I think it's right up my alley and can ensure that I don't make any extra commits to ongoing PR's for my Hacktober. I'll have to give it a try!

Scott Chacon at FOSDEM 2024

Scott Cachon - FOSDEM 2024

Conclusion

Scott covers a few more topics in his video and goes further in depth with these commands, old and new. He also provides some stellar visual examples throughout the PowerPoint presentation. I found his talk entertaining and his "shotgun" style kept topics to the point. It also made me realize there is so much more to learn about Git than I had anticipated. Scott mentioned how there are about 145 git commands, 82 of which is relevant currently. And that is much more than I use in my Git toolbelt.

I'll have follow-up git-based blogs in the near future as I continue researching and learning more!

...

🔧 I watched "So You Think You Know Git" so you don't have to


📈 58.78 Punkte
🔧 Programmierung

📰 If You Don't Have A SASE Cloud Service, You Don't Have SASE At All


📈 28.59 Punkte
📰 IT Security Nachrichten

🪟 YouTube generative AI will soon let you have a conversation about video you’ve just watched


📈 26.89 Punkte
🪟 Windows Tipps

📰 Japanese hotel chain sorry that hackers may have watched guests through bedside robots


📈 23.39 Punkte
📰 IT Security Nachrichten

📰 Japanese Hotel Chain Sorry That Hackers May Have Watched Guests Through Bedside Robots


📈 23.39 Punkte
📰 IT Security Nachrichten

📰 Japanese hotel chain sorry that hackers may have watched guests through bedside robots


📈 23.39 Punkte
📰 IT Security Nachrichten

🔧 Developers Listen: If You Don't Have a Rich Domain Model, You Don't Leverage OOP


📈 23.25 Punkte
🔧 Programmierung

🎥 You Will Wish You Watched This! THE TWISTED TRUTH..


📈 21.55 Punkte
🎥 Video | Youtube

📰 Do you ever feel like you’re being watched for all the wrong reasons?


📈 21.55 Punkte
📰 IT Security Nachrichten

📰 Scam alert: No, hackers don't have webcam vids of you enjoying p0rno. Don't give them any $$s


📈 21.5 Punkte
📰 IT Security Nachrichten

📰 Hackers Made Half a Million Dollars Pretending They Watched You Watch Porn


📈 19.8 Punkte
📰 IT Security Nachrichten

🍏 Wait, you haven’t watched ‘Slow Horses,’ the critically lauded Apple TV+ series?


📈 19.8 Punkte
🍏 iOS / Mac OS

🎥 I Watched You Roll the Die: Unparalleled RDP Monitoring Reveal Attackers' Tradecraft


📈 19.8 Punkte
🎥 IT Security Video

📰 I just watched McDonald's next step into automation and why are you so mad about it?


📈 19.8 Punkte
📰 IT Nachrichten

📰 Netflix Reveals a Series That Is Designed To Be Watched in Any Order You Choose


📈 19.8 Punkte
📰 IT Security Nachrichten

📰 Soccer Fans, You're Being Watched


📈 19.8 Punkte
📰 IT Security Nachrichten

📰 Slashdot Asks: Favorite Movies and TV Shows You Watched This Year?


📈 19.8 Punkte
📰 IT Security Nachrichten

📰 How to See the First Show You Watched on Netflix


📈 19.8 Punkte
📰 IT Security Nachrichten

📰 Never Forget That You Are Being Watched


📈 19.8 Punkte
📰 IT Security Nachrichten

📰 you're being watched, what to do?


📈 19.8 Punkte
📰 IT Security Nachrichten

🔧 I have built an API using TypeScript, Python, and Go, so you don't have to.


📈 19.63 Punkte
🔧 Programmierung

📰 I just watched the future of supermarket shopping and I may run to the hills


📈 18.05 Punkte
📰 IT Nachrichten

📰 'The Queen's Gambit' Scores As Netflix Most-Watched Scripted Limited Series To Date


📈 18.05 Punkte
📰 IT Security Nachrichten

📰 Nine of the 10 Most-Watched Streaming Programs Are Reruns


📈 18.05 Punkte
📰 IT Security Nachrichten

🪟 How Netflix is boosting its 'watched-by' numbers by 35%


📈 18.05 Punkte
🪟 Windows Tipps

🍏 Apple Music’s halftime show with Rihanna the second-most-watched in Super Bowl history


📈 18.05 Punkte
🍏 iOS / Mac OS

📰 Baby Shark Becomes YouTube's Most-Watched Video of All Time


📈 18.05 Punkte
📰 IT Security Nachrichten

matomo