Skip to main content

Command Palette

Search for a command to run...

๐— ๐—ฎ๐˜€๐˜๐—ฒ๐—ฟ๐—ถ๐—ป๐—ด ๐—š๐—ถ๐˜: ๐—จ๐—ป๐—ฑ๐—ฒ๐—ฟ๐˜€๐˜๐—ฎ๐—ป๐—ฑ๐—ถ๐—ป๐—ด ๐˜๐—ต๐—ฒ ๐—ง๐—ต๐—ฟ๐—ฒ๐—ฒ ๐—ž๐—ฒ๐˜† ๐—”๐—ฟ๐—ฒ๐—ฎ๐˜€ ๐—ฎ๐—ป๐—ฑ ๐—›๐—ผ๐˜„ ๐˜๐—ผ ๐—จ๐—ป๐—ฑ๐—ผ ๐—”๐—ฐ๐—ฐ๐—ถ๐—ฑ๐—ฒ๐—ป๐˜๐—ฎ๐—น ๐—–๐—ผ๐—บ๐—บ๐—ถt

Published
โ€ข2 min readโ€ขView as Markdown

If you've ever accidentally committed sensitive files like appsettings.json to GitHub ๐Ÿ˜จ โ€” you're not alone.

Today, I explored two crucial Git concepts:

โœ… ๐—ง๐—ต๐—ฒ ๐—ง๐—ต๐—ฟ๐—ฒ๐—ฒ ๐—ž๐—ฒ๐˜† ๐—”๐—ฟ๐—ฒ๐—ฎ๐˜€ ๐—ถ๐—ป ๐—š๐—ถ๐˜ (๐˜„๐—ถ๐˜๐—ต ๐˜€๐—ถ๐—บ๐—ฝ๐—น๐—ฒ ๐—ฒ๐˜…๐—ฎ๐—บ๐—ฝ๐—น๐—ฒ๐˜€):

  1. ๐—ช๐—ผ๐—ฟ๐—ธ๐—ถ๐—ป๐—ด ๐——๐—ถ๐—ฟ๐—ฒ๐—ฐ๐˜๐—ผ๐—ฟ๐˜†
    This is where you write your code and make changes.
    ๐Ÿ›  ๐—˜๐˜…๐—ฎ๐—บ๐—ฝ๐—น๐—ฒ: You edit appsettings.json or add a new feature in a .cs file.

  2. ๐—ฆ๐˜๐—ฎ๐—ด๐—ถ๐—ป๐—ด ๐—”๐—ฟ๐—ฒ๐—ฎ (๐—œ๐—ป๐—ฑ๐—ฒ๐˜…)
    This is a temporary area where you tell Git which changes you want to include in your next commit.
    ๐Ÿ›  ๐—˜๐˜…๐—ฎ๐—บ๐—ฝ๐—น๐—ฒ: You run git add appsettings.json. Now Git is ready to commit it.

  3. ๐—ฅ๐—ฒ๐—ฝ๐—ผ๐˜€๐—ถ๐˜๐—ผ๐—ฟ๐˜† (๐—Ÿ๐—ผ๐—ฐ๐—ฎ๐—น ๐—ฅ๐—ฒ๐—ฝ๐—ผ)
    This is where your committed history is stored.
    ๐Ÿ›  ๐—˜๐˜…๐—ฎ๐—บ๐—ฝ๐—น๐—ฒ: You run git commit -m "Added config". Now that file is permanently saved in your local repo (and possibly pushed to GitHub).

๐Ÿ”„ ๐—›๐—ผ๐˜„ ๐˜๐—ผ ๐—จ๐—ป๐—ฑ๐—ผ ๐—”๐—ฐ๐—ฐ๐—ถ๐—ฑ๐—ฒ๐—ป๐˜๐—ฎ๐—น ๐—–๐—ผ๐—บ๐—บ๐—ถ๐˜๐˜€ (๐˜„๐—ถ๐˜๐—ต๐—ผ๐˜‚๐˜ ๐—น๐—ผ๐˜€๐—ถ๐—ป๐—ด ๐—น๐—ผ๐—ฐ๐—ฎ๐—น ๐˜„๐—ผ๐—ฟ๐—ธ)

Letโ€™s say you accidentally committed a file like appsettings.json to GitHub. Hereโ€™s how to fix it:

  1. Add the file to .gitignore: appsettings.json

  2. Remove it from Git tracking (but keep it locally): git rm --cached appsettings.json

  3. Commit the removal: git commit -m "Remove sensitive file from tracking"

  4. Push the clean state: git push origin main --force

๐Ÿ’ก ๐—ค๐˜‚๐—ถ๐—ฐ๐—ธ ๐—ง๐—ถ๐—ฝ:
Use git reset --soft HEAD~1 to remove the last commit but keep your code changes safe locally.

๐—ง๐—ต๐—ฎ๐—ป๐—ธ๐˜€ ๐˜๐—ผ ๐˜๐—ต๐—ฒ ๐—ค๐˜‚๐—ถ๐—ฐ๐—ธ ๐—ง๐—ถ๐—ฝ, ๐—œ ๐—ฑ๐—ฒ๐—น๐—ฒ๐˜๐—ฒ๐—ฑ ๐—ฟ๐—ฒ๐—ฐ๐—ฒ๐—ป๐˜ ๐—ฐ๐—ผ๐—บ๐—บ๐—ถ๐˜๐˜€ ๐˜„๐—ถ๐˜๐—ต ๐—ฒ๐—ฎ๐˜€๐—ฒ.

โ“ ๐—›๐—ฎ๐˜ƒ๐—ฒ ๐˜†๐—ผ๐˜‚ ๐—ฒ๐˜ƒ๐—ฒ๐—ฟ ๐—ฐ๐—ผ๐—บ๐—บ๐—ถ๐˜๐˜๐—ฒ๐—ฑ ๐—ฎ ๐˜€๐—ฒ๐—ฐ๐—ฟ๐—ฒ๐˜ ๐—ผ๐—ฟ ๐—ฐ๐—ผ๐—ป๐—ณ๐—ถ๐—ด ๐—ณ๐—ถ๐—น๐—ฒ ๐—ฏ๐˜† ๐—บ๐—ถ๐˜€๐˜๐—ฎ๐—ธ๐—ฒ?
๐—ช๐—ต๐—ฎ๐˜โ€™๐˜€ ๐˜†๐—ผ๐˜‚๐—ฟ ๐—ด๐—ผ-๐˜๐—ผ ๐—บ๐—ฒ๐˜๐—ต๐—ผ๐—ฑ ๐˜๐—ผ ๐˜‚๐—ป๐—ฑ๐—ผ ๐—ถ๐˜ ๐˜„๐—ถ๐˜๐—ต๐—ผ๐˜‚๐˜ ๐—น๐—ผ๐˜€๐—ถ๐—ป๐—ด ๐—ฝ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฒ๐˜€๐˜€?

More from this blog

๐—ฃ๐—ฎ๐˜€๐˜€๐˜„๐—ผ๐—ฟ๐—ฑ๐—น๐—ฒ๐˜€๐˜€ ๐—”๐˜‚๐˜๐—ต๐—ฒ๐—ป๐˜๐—ถ๐—ฐ๐—ฎ๐˜๐—ถ๐—ผ๐—ป ๐—ฅ๐—ฒ๐˜ƒ๐—ผ๐—น๐˜‚๐˜๐—ถ๐—ผ๐—ป

Passwords are the weakest link โ€” and .NET 10 just made it easier to remove them. With built-in support for passkeys and WebAuthn, you can authenticate users securely without storing a single password. .NET 10 introduces native passwordless authentica...

Nov 4, 20251 min read

.๐—ก๐—˜๐—ง ๐Ÿญ๐Ÿฌ ๐— ๐—ฎ๐—ธ๐—ฒ๐˜€ ๐—Ÿ๐—˜๐—™๐—ง & ๐—ฅ๐—œ๐—š๐—›๐—ง ๐—๐—ผ๐—ถ๐—ป๐˜€ ๐—˜๐—ฎ๐˜€๐—ถ๐—ฒ๐—ฟ ๐—ง๐—ต๐—ฎ๐—ป ๐—˜๐˜ƒ๐—ฒ๐—ฟ!

If youโ€™ve ever struggled to write complex LEFT JOINs in LINQ, youโ€™ll love whatโ€™s coming in .NET 10. No more juggling SelectMany, GroupJoin, and DefaultIfEmpty โ€” Microsoft just made it clean, readable, and developer-friendly! In .NET 10, LINQ gets fir...

Nov 1, 20251 min read

๐Ÿ”ฅ .๐—ก๐—˜๐—ง ๐—™๐—ฟ๐—ฎ๐—บ๐—ฒ๐˜„๐—ผ๐—ฟ๐—ธ ๐˜ƒ๐˜€ .๐—ก๐—˜๐—ง ๐—–๐—ผ๐—ฟ๐—ฒ โ€” ๐—ž๐—ฒ๐˜† ๐——๐—ถ๐—ณ๐—ณ๐—ฒ๐—ฟ๐—ฒ๐—ป๐—ฐ๐—ฒ๐˜€ ๐—˜๐˜…๐—ฝ๐—น๐—ฎ๐—ถ๐—ป๐—ฒ๐—ฑ

If youโ€™re preparing for a .NET developer interview, this is one question you canโ€™t afford to miss! Letโ€™s break down the core differences that every developer should know ๐Ÿ‘‡ 1๏ธโƒฃ Platform Support โ€“ .NET Framework works only on Windows, while .NET Core ...

Oct 30, 20252 min read

๐—˜๐—ฎ๐—ด๐—ฒ๐—ฟ ๐˜ƒ๐˜€ ๐—Ÿ๐—ฎ๐˜‡๐˜† ๐—Ÿ๐—ผ๐—ฎ๐—ฑ๐—ถ๐—ป๐—ด

In ๐—˜๐—ป๐˜๐—ถ๐˜๐˜† ๐—™๐—ฟ๐—ฎ๐—บ๐—ฒ๐˜„๐—ผ๐—ฟ๐—ธ ๐—–๐—ผ๐—ฟ๐—ฒ, how and when related data is fetched matters โ€” thatโ€™s where ๐—˜๐—ฎ๐—ด๐—ฒ๐—ฟ ๐—Ÿ๐—ผ๐—ฎ๐—ฑ๐—ถ๐—ป๐—ด and ๐—Ÿ๐—ฎ๐˜‡๐˜† ๐—Ÿ๐—ผ๐—ฎ๐—ฑ๐—ถ๐—ป๐—ด come in. ๐—˜๐—ฎ๐—ด๐—ฒ๐—ฟ ๐—Ÿ๐—ผ๐—ฎ๐—ฑ๐—ถ๐—ป๐—ด means related data is loaded immediately with the main e...

Oct 29, 20251 min read

Visual Studio Updates

89 posts