1️⃣2️⃣ Git Ignore & Git Large File Storage (LFS)
Git provides ways to ignore unnecessary files and handle large files efficiently, ensuring your repository remains clean and optimized.
Shape Your Future with AI & Infinite Knowledge...!!
Want to Generate Text-to-Voice, Images & Videos?
http://www.ai.skyinfinitetech.com
Read In-Depth Tech & Self-Improvement Blogs
http://www.skyinfinitetech.com
Watch Life-Changing Videos on YouTube
https://www.youtube.com/@SkyInfinite-Learning
Transform Your Skills, Business & Productivity – Join Us Today! 
🔹 .gitignore File – Ignoring Unwanted Files
Sometimes, there are files you don’t want to track in Git, such as:
✅ Temporary files (.log, .tmp, .swp)
✅ System-generated files (.DS_Store, Thumbs.db)
✅ Compiled code (.class, .o, .exe)
✅ Environment files (.env, node_modules, venv)
You can tell Git to ignore such files by creating a .gitignore file.
1️⃣ Creating a .gitignore File
To create a .gitignore file, simply run:
Then, open it and add the files or directories to ignore:
✅ To check which ignored files exist in your repo:
✅ To apply changes after modifying .gitignore:
🔹 Handling Large Files with Git LFS
By default, Git is not designed for large binary files (such as videos, images, or large datasets). Git Large File Storage (LFS) helps manage large files without bloating your repository.
1️⃣ Installing Git LFS
Install Git LFS using:
After installing, initialize Git LFS in your repository:
2️⃣ Tracking Large Files with Git LFS
To track specific file types (e.g., .psd, .mp4, .zip), use:
This creates a .gitattributes file, which Git uses to manage large files.
✅ To check tracked files:
3️⃣ Committing Large Files
Once tracked, commit the large files as usual:
🔹 Benefits of Git LFS
✅ Reduces repository size by storing only pointers to large files.
✅ Speeds up Git operations by avoiding unnecessary file transfers.
✅ Efficient for teams working with media, datasets, or binaries.
🔹 Best Practices
✔️ Always use .gitignore to keep your repository clean.
✔️ Use Git LFS only for large binary files.
✔️ Regularly check ignored files using git status --ignored.
✔️ Avoid tracking unnecessary files before committing.
By using .gitignore and Git LFS, you can keep your repository lightweight, clean, and efficient! 🚀
📚 Top 5 Books That Will Change Your Life!(Top 5 Life-Changing Books) 🚀
1️⃣ Atomic Habits – Build powerful habits and break bad ones!
2️⃣ The Psychology of Money – Master your financial mindset!
3️⃣ Think and Grow Rich – Unlock the secrets to wealth and success!
4️⃣ The Power of Your Subconscious Mind – Train your mind for success!
5️⃣ Rich Dad Poor Dad – Learn financial lessons the rich teach their kids!
No comments:
Post a Comment