Deep ThoughtsBlog
← Back to all writing

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