Programming Tips πŸ’‘
51.5K subscribers
67 photos
10 videos
30 files
354 links
Programming & AI:
Tips πŸ’‘
Articles πŸ“•
Resources πŸ‘Ύ
Design Patterns πŸ’Ž
Software Principles βœ…

πŸ‡³πŸ‡± Contact: @MoienTajik

🎯 Buy ads: https://telega.io/c/ProgrammingTip
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
Git - Differences Between Commits πŸ™‡πŸ»

To see the changes of the last commit, you can use:

 $ git log β€”stat 


This command will show the files and the number of lines added and removed by file in each commit. πŸ’Ž

To see what exactly was changed in a commit, use git diff. πŸ’₯

To see the difference between two commits using sha s of commits in hand (0da94be and 59ff30c), use:

$ git diff 0da94be 59ff30c


#git #commit
@ProgrammingTip
Gitignore ✨

Create useful .gitignore files for your project. πŸ€™πŸ»

Tell gitignore.io about your operating system, development environment and programming language of choice, and it’ll generate a .gitignore file. πŸ‘Ύ

https://t.me/pgimg/22

[ Website ] : gitignore.io
γ€°γ€°γ€°γ€°γ€°γ€°
#Git #Gitignore
@ProgrammingTip
Axosoft GitKraken: Unleash Your Repo! πŸ™

The legendary Git GUI client for Windows, Mac and Linux. 🐧

Axosoft GitKraken is a Git client with efficiency, elegance and reliability at the core. It was made for devs by devs. 🀘

Features
You can do all the standard things you should be able to do with a git client; branching, merging, pulling, pushing, reverting, etc. ✨

The range of options you have for each commit πŸ”₯
πŸ”Ή Set Upsteam
πŸ”Έ Branch from a historic commit
πŸ”Ή Cherrypick from commit
πŸ”Έ Revert the commit
πŸ”Ή Edit the commit message
πŸ”Έ Deleting the commit (and remote versions of it)
πŸ”Ή Creating a tag from a commit

https://t.me/pgimg/66

[Website] : https://gitkraken.com

γ€°γ€°γ€°γ€°γ€°γ€°
#Git #VCS
@ProgrammingTip
Never commit code that’s been commented out 🚫

I’ve never understood the reasoning behind committing code that’s been commented out. πŸ€”

I assume it’s to keep old versions of the code around just in case the new code doesn’t work, but that’s just bizarre. ⚠️

Keeping track of old versions is the reason we use a version control system in the first place❗️

Why was the code commented out❔
Does it work❔
Should it work❔
Has it ever worked❔
Is it something we should strive towards or run away from❔

Code that’s been commented out is worse than useless, because every time it’s read, it raises questions like these without providing any answers. ❌

It only serves to confuse and distract from the code in use. 🀯


https://t.me/pgimg/134

γ€°γ€°γ€°γ€°γ€°γ€°
#Tips #Git
@ProgrammingTip
Oh shit, git❗️

Git is hard: screwing up is easy, and figuring out how to fix your mistakes is fucking impossible. πŸ€·πŸ»β€β™‚οΈ

Git documentation has this chicken and egg problem where you can't search for how to get yourself out of a mess, unless you already know the name of the thing you need to know about in order to fix your problem. πŸ€¦πŸ»β€β™‚οΈ

So here are some bad situations I've gotten myself into, and how I eventually got myself out of them in plain english*. βœ…

[ Website ] : ohshitgit.com

〰️〰️〰️〰️〰️〰️
#Git #SourceControl
@ProgrammingTip
The guide to Git I never had 🎯

Understanding Git is crucial for any developer. Often overlooked in CVs, mastering Git's capabilities enhances your coding proficiency significantly. This guide covers everything from basic commands to advanced techniques, ensuring you can manage and track your code effectively. βœ”οΈ

In this comprehensive guide, we delve into branches, commits, merging, rebasing, and more to help you master this essential tool. ⚑️

[ Article ]: https://medium.com/@jake.page91/the-guide-to-git-i-never-had-a89048d4703a

〰️〰️〰️〰️〰️〰️
#Git #VersionControl
@ProgrammingTip