Network+ Exam
Source Control
October 29, 2025
- #network+
Source Control
version control ,
git - mature, actively maintend open-source project
git repository - storage area where versions of code and related files are stored.
config - set options for repository
git init create git repo or reinitilize
clone create a copy
add add files to be tracked by git
commit - upgate the git repo with changes
status deplay the staus
branch mange branches after changes
merge intergrate changes into master branch
pull aquire mercge change
push upload llocal wokring copy
log display changes
checkout switch to a specefic branch
branching - feature available in most modern version control systems.
git branch neew branch
git merge newbranch
.gitignore
π Version Control & Git
π Why Version Control Matters
- Tracks changes to files (usually code/configs).
- Supports collaboration, rollback, and auditing.
- Git = most widely used, open-source, actively maintained.
π¦ Core Git Concepts
- Repository (repo): Storage area where versions of code/files are kept.
- Branching: Parallel lines of development; merge when changes are stable.
- .gitignore: File that specifies what Git should ignore (e.g., secrets, temp files).
βοΈ Common Git Commands
- Initialization & Setup
git initβ Create or reinitialize a repo.git configβ Set options (username, email, etc.).
- Working with Repos
git clone <url>β Create a copy of an existing repo.git statusβ Show current state of repo.git logβ Display commit history.
- Tracking Changes
git add <file>β Stage a file to be tracked.git commit -m "message"β Save staged changes to repo.
- Branching & Merging
git branch <name>β Create new branch.git checkout <name>β Switch to branch.git merge <branch>β Merge branch into current branch.
- Syncing Changes
git pullβ Acquire and merge changes from remote.git pushβ Upload local commits to remote repo.
β Exam/Job Tie-In
- Git often shows up in DevOps, automation, and config management.
- Knowing basic commands is useful for scripting, auditing, and network automation labs.
- Branching/merging is crucial for team collaboration.
β‘ Sample Question:
βWhich Git command is used to stage changes before committing them to the repository?β
β git add