🌐 Detecting your location…
📢 Advertisement — Configure AdSense in Appearance → Customize → AdSense Settings

গিট ইন্টারভিউ প্রশ্ন 2026: মার্জ, রিবেস, রিসেট এবং ব্রাঞ্চিং

⏱️4 min read  ·  670 words

Git ইন্টারভিউ প্রশ্ন সংস্করণ নিয়ন্ত্রণ ধারণা, শাখা কৌশল, মার্জ বনাম রিবেস, এবং সহযোগী কর্মপ্রবাহ সম্পর্কে আপনার বোঝার পরীক্ষা করে। এই গাইডটি 2026 সালে সফ্টওয়্যার বিকাশকারীর সাক্ষাত্কারের জন্য সবচেয়ে বেশি জিজ্ঞাসিত Git প্রশ্নগুলি কভার করে।

মূল গিট প্রশ্ন

1. গিট মার্জ এবং গিট রিবেসের মধ্যে পার্থক্য কী?

# merge: combines two branches, preserves full history
git checkout feature
git merge main
# Creates a merge commit — shows when branches diverged

# rebase: moves/replays commits on top of another branch
git checkout feature
git rebase main
# Linear history — as if feature branched off current main

# When to use merge:
# - Integrating feature branches to main (preserves history)
# - Public/shared branches (never rebase!)
# - When you want to see branch history

# When to use rebase:
# - Keeping feature branch up to date with main
# - Cleaning up local commits before PR
# - Squashing minor fix commits

# Golden rule: never rebase commits that have been pushed to shared branches

2. হেড কি এবং একটি বিচ্ছিন্ন মাথা কি?

# HEAD = pointer to current commit (usually points to branch tip)
cat .git/HEAD  # ref: refs/heads/main  (pointing to main branch)

# Detached HEAD: HEAD points directly to a commit, not a branch
git checkout abc123  # checking out a specific commit
# HEAD is now at abc123 (detached)
# Any commits made won't belong to any branch!

# To save work in detached HEAD:
git checkout -b new-branch  # create branch from current position

# Common cause: git checkout <tag> or git checkout <commit-hash>

3. গিট রিসেট বনাম গিট রিভার্ট ব্যাখ্যা কর

# git reset: move HEAD backward (rewrites history)
git reset --soft HEAD~1    # undo commit, keep changes staged
git reset --mixed HEAD~1   # undo commit, keep changes unstaged (DEFAULT)
git reset --hard HEAD~1    # undo commit AND discard changes (DESTRUCTIVE)

# NEVER use --hard on shared branches!

# git revert: create a new commit that undoes a previous commit
git revert abc123          # safe for shared branches
# Creates commit: "Revert 'feature: add user auth'"

# Use reset for: local commits you want to undo
# Use revert for: commits already pushed to shared branches

4. গিট স্ট্যাশ কি এবং আপনি কখন এটি ব্যবহার করবেন?

# Temporarily save uncommitted changes
git stash push -m "WIP: half-done feature"
git stash list                           # see all stashes
git stash pop                            # apply latest + remove
git stash apply stash@{0}               # apply without removing
git stash drop stash@{0}               # delete a stash

# Stash specific files
git stash push -m "CSS fix" -- styles.css components/Button.css

# Include untracked files
git stash push -u -m "including new files"

# Common workflow:
# 1. Working on feature-A
# 2. Urgent fix needed on feature-B
# git stash (save feature-A work)
# git checkout feature-B
# ... fix ...
# git checkout feature-A
# git stash pop (restore feature-A work)

5. আপনি কিভাবে একাধিক কমিট স্কোয়াশ করবেন?

# Interactive rebase — squash last 3 commits
git rebase -i HEAD~3

# Editor opens:
# pick abc123 feat: add login form
# pick def456 fix: correct validation
# pick ghi789 fix: typo in error message

# Change to:
# pick abc123 feat: add login form
# squash def456 fix: correct validation
# squash ghi789 fix: typo in error message

# Result: one clean commit with combined message

# Alternative: squash merge (GitHub/GitLab button)
# When merging PR, select "Squash and merge"
# All commits become one commit in main

6. চেরি-পিক কি?

# Apply a specific commit from another branch
git log --oneline feature-branch  # find the commit hash
git cherry-pick abc123            # apply just that commit

# Common use: apply a hotfix to multiple release branches
git checkout release/2.0
git cherry-pick fix/critical-bug-abc123
git checkout release/1.9
git cherry-pick fix/critical-bug-abc123

# Cherry-pick a range
git cherry-pick abc123..def456  # applies all commits in range

# If conflicts arise
git cherry-pick --continue  # after resolving conflicts
git cherry-pick --abort     # cancel cherry-pick

7. ব্রাঞ্চিং কৌশল ব্যাখ্যা করুন

GitFlow (complex, stable releases):
  main          — production
  develop       — integration
  feature/xxx   — feature branches
  release/1.0   — release preparation
  hotfix/xxx    — urgent fixes

GitHub Flow (simple, continuous delivery):
  main          — always deployable
  feature/xxx   — short-lived feature branches
  Pull Request → Code Review → Merge to main → Deploy

Trunk-Based Development (very short-lived branches):
  main (trunk)  — everyone commits daily
  feature/xxx   — max 1-2 days old, use feature flags

2026 recommendation: GitHub Flow or Trunk-Based for most teams

8. .gitignore কি এবং কেন এটি গুরুত্বপূর্ণ?

# .gitignore tells git which files to ignore
# Never commit:
# - Secrets/credentials (.env files!)
# - Dependencies (node_modules/, vendor/)
# - Build artifacts (dist/, __pycache__/)
# - OS files (.DS_Store, Thumbs.db)
# - IDE files (.idea/, .vscode/ — optional)

# Example .gitignore
*.env
*.env.*
node_modules/
dist/
build/
.DS_Store
__pycache__/
*.pyc
*.pem
*.key

# Already committed? Remove from tracking:
git rm --cached .env        # stop tracking but keep file
git rm -r --cached dist/    # stop tracking directory

# Global gitignore (applies to all repos)
git config --global core.excludesfile ~/.gitignore_global

গিট সাক্ষাত্কারের সাফল্য: ইতিহাসের মডেল (কমিট, শাখা, হেড) বুঝুন, মার্জ এবং রিবেসের মধ্যে পার্থক্য জানুন এবং প্রতিটি কখন ব্যবহার করতে হবে, রিসেট বনাম রিভার্ট স্পষ্টভাবে ব্যাখ্যা করুন এবং টিম ওয়ার্কফ্লো (গিটহাব ফ্লো, গিটফ্লো) সম্পর্কে জ্ঞান প্রদর্শন করুন। বাস্তব সংগ্রহস্থলগুলিতে অনুশীলন করুন — গিট ইতিহাস পড়া তাত্ত্বিকভাবে বর্ণনা করার চেয়ে সহজ।

✍️ Leave a Comment

Your email address will not be published. Required fields are marked *

🌐 Read in:🇬🇧 English🇩🇪 Deutsch🇧🇷 Português🇸🇦 العربية🇮🇳 हिन्दी🇧🇩 বাংলা