summergugl.blogg.se

Yoink definition
Yoink definition












yoink definition

Think of this like throwing all your belongings in a bag, and git stash apply is like dumping everything out onto the floor.

  • Whenever you run "vanilla" git stash, you're merging your current changes with all the other changes in the stash.
  • You also may be new to using push and pop on your stash, instead of apply and clear (as I often used to do). Clarification on using stash vs stash push but if your team runs automated scripts whenever you pull, you'll probably want the original command I described. 💡 Note: is easy to achieve with a fetch command as well: git fetch origin master:master This is super convenient for grabbing the latest changes to force rebase the branch we're working on. In other words, we are grabbing the main branch and bringing it back to the branch we're on 😁 We pull this off using the git checkout - command after running gimme. For some etymology, I'll include the urban dictionary entry on what it means to yoink:Īn exclamation that, when uttered in conjunction with taking an object, immediately transfers ownership from the original owner to the person using the word regardless of previous property rights. This phrase is certainly a close relative to gimme. yoink 🎣 alias yoink = "gimme & git checkout - & git stash pop" So, it's super useful to return to main and grab all this new content in one go.

    yoink definition

    This is the simplest command of the bunch, but it's also my most-used! On my team, we run a lot of automated scripts on pull for installing dependencies and pulling content from our CMS. That -r flag will be sure to "rebase" onto the latest, preventing unecessary merge conflicts. Next, it checks out your main branch and pulls the latest contents. It also saves "untracked" / new files with the -u flag. It assumes you might not be on the main branch just yet, so it'll stash everything you're working on using the stash command. This is my "return to home base" command. gimme ✊ alias gimme = "git stash push -u & git checkout main & git pull -r" ✋ But wait! Before you blindly copy these, let's unpack each of them a little.

    Yoink definition install#

    And for all you windows users out there: you'll probably need to install the Git Bash terminal (included with Git) and create the file like so.

    yoink definition

    So if you want to use these in your own terminal, go find your bashrc and paste away! This is usually found in your user directory: ~/.bashrc. Here's my 4 shortcuts for slamming through daily tasks 💪 # Stash what I'm working on and checkout the latest master alias gimme = "git stash push -u & git checkout main & git pull -r" # Grab the latest master and come back to the branch I was on (with stashing!) alias yoink = "gimme & git checkout - & git stash pop" # Checkout a new branch and push it to origin (so I don't forget that set-upstream) woosh ( ) # ALL TOGETHER NOW # Stash my current WIP, checkout a new branch off the latest master, and push it to origin alias boop = "gimme & woosh" 🧶 Writing aliases for your terminal to tie it all togetherĪlright, let's do the big reveal. 🍾 The importance of pushing and popping your stash You know you cringe a little every time this pops up 😬 Git push -set-upstream origin crap-not-again But when I'm hurrying, it's so easy to either a) work off an old "main" branch, or b) do the copy-paste of shame before your PR: To push the current branch and set the remote as upstream, use I'll probably do this 5+ times in one day if we're in a bug-squashing flow.

  • I need to push that branch to origin before opening my PR.
  • Stop me if you've seen this workflow before: Naturally, I started automating the workflows I use day-in and day-out 😁 I started my first full-time job as a programmer this year, which means I've been picking up a lot of new tricks in a pretty quick timeframe.














    Yoink definition