Image representing this week's "TWIL" blog post on coding shortcuts, Git flag optimizations, and commit amendment techniques.

Welcome to "TWIL," our weekly digest empowering micro-learning of tech's most engaging complexities. This week, Katie unveils shortcuts for seasoned and aspiring coders alike. Learn the subtle art of tweaking commands with Edit and Re-run Previous Shell Command in Shell, where a simple 'fc' unfolds into a streamlined command-editing workflow. Navigate Git with ease as Katie illustrates how to shorten Git flags intelligently; recognizing when a fragment of a flag is enough to command attention. Finally, perfect your commit game with insights on using Commit Amend with the Same Message in Git, turning omissions and errors into seamless corrections.

Edit and re-run previous shell command

To edit and re-run the previous shell command:

fc

This will open up the previously-run command to edit in Vim; this can be useful for correcting typos in long commands or rearranging flags/args easily.

To run the updated command, just write-quit in Vim and the edited command will be run in the shell upon exit.

  • Shell
Katie Linero's profile picture
Katie Linero

Senior Software Engineer


Git flag shortening

When using git, you only need to type the flag as far as it is ambiguous. For example:

--no-edit:

--no-e

--force-with-lease:

--force-w
  • Git
Katie Linero's profile picture
Katie Linero

Senior Software Engineer


Commit amend with same message

If you want to simply amend a commit without changing the message (I personally use this a lot for correcting typos or leftover comments I catch after I've already committed, for example):

git commit --amend --no-edit

Documentation for --amend:

https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---amend

Documentation for --no-edit:

https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---amend

  • Git
Katie Linero's profile picture
Katie Linero

Senior Software Engineer

Related Posts

A conceptual illustration shows a chat bubble icon at the center of a complex maze, representing the challenges of evaluating Large Language Models for commercial applications. The intricate blue-tinted labyrinth symbolizes the many considerations Cuttlesoft navigates when implementing AI solutions in enterprise software - from API integration and cost management to security compliance. This visual metaphor captures the complexity of choosing the right LLM technology for custom software development across healthcare, finance, and enterprise sectors. The centered message icon highlights Cuttlesoft's focus on practical communication AI applications while the maze's structure suggests the methodical evaluation process used to select appropriate AI tools and frameworks for client solutions.
September 12, 2024 • Frank Valcarcel

Benchmarking AI: Evaluating Large Language Models (LLMs)

Large Language Models like GPT-4 are revolutionizing AI, but their power demands rigorous assessment. How do we ensure these marvels perform as intended? Welcome to the crucial world of LLM evaluation.

Frank Valcarcel speaking at Denver Startup Week 2018 on healthcare technology and HIPAA compliance, highlighting the digital revolution in healthcare IT
October 5, 2018 • Frank Valcarcel

Scaling Healthcare Technologies at DSW 2018

Discover the transformative journey of healthcare technology at Denver Startup Week 2018 with Frank . Dive into the world of healthcare software, product management, and the critical balance between innovation and HIPAA compliance.