Git Branch Isolation Tutorial: Why Uncommitted Files Follow You, Stash vs Commit, and .gitignore
DevTipsForYouuu
0:00 / 0:00
Git Branch Isolation Tutorial: Why Uncommitted Files Follow You, Stash vs Commit, and .gitignore
9 просмотров · 2 нед. назад
DevTipsForYouuu
5 подписчиков
9 просмотров · 2 нед. назад
A real-world, complete DevOps Git challenge walkthrough on setting up production workspaces, isolating feature code, and configuring ignore rules. If you have ever wondered why changes you made on one branch suddenly show up on another branch when running git checkout, how to prevent unfinished edits from leaking across branches, or why your commit failed with "error: pathspec did not match any file(s)", this video breaks down the full workflow step by step.
Search topics, real-world problems, and common questions covered in this video:
⚬ How to initialize a configuration repository and save a production baseline
⚬ How to create and switch to feature branches using git branch and git checkout
⚬ Why uncommitted modified files travel with you when switching branches (dirty working tree)
⚬ How to isolate code to a single branch using git commit or git stash
⚬ How to set up .gitignore with wildcard extensions like *.log and specific text files
⚬ Verifying that ignored files are hidden from git status while keeping the .gitignore file tracked
⚬ How to fix the common error "pathspec did not match any file(s) known to git" by quoting commit messages
⚬ Verifying branch isolation by checking how files change between master and feature branches
Commands covered:
mkdir server_config
cd server_config
git init
git add nginx.conf
git commit -m "first commin new file"
git log --oneline
git branch new_branch
git checkout new_branch
touch debug.txt something.log
git add .gitignore
git commit -m "cool"
git checkout master
git checkout new_branch
git commit -m "new changes"
git checkout master
#Git #GitTutorial #GitBranch #DevOps #LearnGit #CodingForBeginners #WebDevelopment #Programming #SoftwareEngineering #VersionControl #GitIgnore #LinuxTerminal