Programming & AI Tips 💡
46K subscribers
67 photos
11 videos
30 files
385 links
Programming & AI:
Tips 💡
Articles 📕
AI & LLMs 👾
Design, Architecture, Principles ✅

🇳🇱 Contact: @MoienTajik
Download Telegram
Git - Stash Saves Time 💎

The command git stash , picks All the changes in staging and save it in a separate place. Thus, this useful and aptly named command clears your staging area. 🔥

That way you can save a set of changes you have made but do not yet want to commit. 💥

$ git stash


Or, if you would need to stash untracked changes as well, use -u argument: 💡

$ git stash -u


In particular, I use more stash when I need to git pull and want to avoid conflicts between local changes and changes upstream.
¯\_(ツ)_/¯

To restore your local changes back to staging, you need to apply your stash. The following command recreates the latest changes that were stashed away: ✔️

 $ git stash apply 


You can have more than one stash. By default, your stashes will be applied in FILO (First-in, last-out) order.

#git #vcs #stash
@ProgrammingTip