
Introduction
Every developer eventually has the same awful moment: a file that worked yesterday is broken today, and nobody remembers what changed. Or two teammates overwrite each other’s work. Or a late-night edit wipes out a week of effort.
Git exists to make those moments survivable. This Git complete guide takes you from “what is a repository?” to the workflows used in real software companies. It is written for students, freshers and working developers who want to be industry-ready. Every section includes commands you can try in your own terminal.
One honest note before we start: Git is powerful, but it is not magic. It does not guarantee your code is correct, it cannot stop every mistake, and it cannot resolve every conflict for you. What it does is give you a complete, recoverable history and a safe way to collaborate. That is more than enough to change how you work.
Table of Contents
- Introduction to Git
- Git Architecture and Internal Working
- Installation and Initial Configuration
- Essential Git Commands
- Branching and Branch Management
- Merge and Merge Strategies
- Merge Conflicts: Complete Practical Guide
- Rebase vs Merge
- Reset, Revert and Restore
- Cherry-Pick and Stash
- GitHub, GitLab and Bitbucket
- Industry-Level Git Workflows
- Common Git Errors and Solutions
- Advanced Git Concepts
- Git Security and Best Practices
- Real-World Industry Projects
- The Human Impact of Git
- Git Interview Questions
- Git Command Cheat Sheet
- FAQ and Conclusion
1. What Is Git? Introduction to Version Control
What is Git?
Git is a free, open-source distributed version control system (DVCS). It records changes to files over time so you can recall specific versions later, compare them, undo mistakes and work with other people on the same project.
What is version control?
Version control is the practice of tracking and managing changes to files. Without it, people create folders like project_final, project_final_v2 and project_final_REALLY_final. That approach breaks down the moment a second person joins.
Who created Git and why?
Linus Torvalds created Git in 2005 for the Linux kernel project. The kernel community had been using a proprietary tool, and when that arrangement ended, they needed a fast, free system that could handle thousands of contributors. Git’s design goals were speed, simple design, strong support for non-linear development (thousands of parallel branches) and the ability to handle very large projects.
Problems that existed before Git
- Files were copied manually into dated folders
- Older centralized tools needed a constant connection to a server
- Branching and merging were slow and painful
- One server failure could mean losing the whole history
- Teams overwrote each other’s changes
Centralized vs distributed version control
| Aspect | Centralized (e.g. SVN) | Distributed (Git) |
| Repository | One central server holds the history | Every clone holds the full history |
| Offline work | Very limited | Commit, branch and view history offline |
| Speed | Network-dependent | Most operations are local and fast |
| Backup | Server is a single point of failure | Every clone is a backup |
| Branching | Often heavy | Lightweight and cheap |
Why companies use Git and why it is an essential skill
Nearly every software company uses Git because it lets large teams work in parallel, review each other’s code, track who changed what and why, and roll back problems. For individual developers, it is a safety net. For teams, it is the backbone of collaboration and release management. Job descriptions for developers, testers and DevOps engineers almost always list it.
A real-world example
Imagine you spend three days rewriting a payment module. On day four you realize the new approach has a serious bug. Without Git, you either try to remember what you changed or start over. With Git, you committed at the end of each day, so you run a single command to compare against the last working commit, or return to it. Your work is not lost; it is just a few commands away.
2. Git Architecture and Internal Working
The four areas
| Area | What it is |
| Working Directory | The actual files on your disk that you edit |
| Staging Area (Index) | A holding area where you prepare exactly what goes into the next commit |
| Local Repository | The .git folder holding your commit history and objects |
| Remote Repository | A copy hosted elsewhere (GitHub, GitLab, Bitbucket, a company server) |
Lifecycle: Working Directory → (git add) → Staging Area → (git commit) → Local Repository → (git push) → Remote Repository.
flowchart LR
A[Working Directory] — git add –> B[Staging Area]
B — git commit –> C[Local Repository]
C — git push –> D[Remote Repository]
D — git fetch –> C
D — git pull –> A
C — git checkout / switch / restore –> A
(Note: if your editor does not render Mermaid, paste the code into mermaid.live to export an image.)
Git objects
Inside .git/objects, Git stores everything as objects, each identified by a SHA hash of its contents (SHA-1 traditionally, with SHA-256 supported in newer repositories).
| Object | Purpose |
| Blob | Stores the content of a file (not its name) |
| Tree | Represents a directory: maps names to blobs and other trees |
| Commit | Points to a tree (the snapshot), parent commit(s), author, timestamp and message |
| Tag (annotated) | A full object with tagger, date, message and optional signature |
A lightweight tag is just a name pointing to a commit, with no extra metadata. An annotated tag is a real object and is preferred for releases.
Snapshots, not diffs
Git thinks in snapshots. Each commit records what the whole project looked like at that moment. Unchanged files are not copied again; the new tree simply points to the same blobs. (For storage efficiency, Git later compresses objects into packfiles using deltas, but conceptually each commit is a snapshot.)
How Git tracks changes and identifies history
Because an object’s name is a hash of its content, any change in content produces a different hash. A commit’s hash includes its parent’s hash, so history forms a chain. Altering an old commit changes every hash after it. This is why rewriting history is visible and why shared history should not be rewritten casually.
HEAD and branch references
- A branch is a movable pointer to a commit, stored as a small file in .git/refs/heads/.
- HEAD is a pointer to your current position, usually pointing at the current branch.
- When you commit, the current branch pointer moves forward to the new commit.
You can inspect objects directly:
git cat-file -t HEAD
git cat-file -p HEAD
commit
tree 9f2c…
parent 3a7b…
author Asha <asha@example.com> 1731744000 +0530
Add login validation
(Hashes shown are shortened and illustrative.)
3. Git Installation and Initial Configuration
Installation
Windows: Download Git for Windows from git-scm.com and run the installer. It includes Git Bash. Alternatively: winget install –id Git.Git -e
Linux:
# Debian / Ubuntu
sudo apt update && sudo apt install git
# Fedora
sudo dnf install git
macOS:
brew install git
# or install Xcode Command Line Tools
xcode-select –install
Verify:
First-time configuration
git config –global user.name “Your Name”
git config –global user.email “your@email.com”
git config –global init.defaultBranch main
git config –list
Configuration levels
| Level | Flag | File location (typical) | Applies to |
| System | –system | Git install folder / /etc/gitconfig | Every user on the machine |
| Global | –global | ~/.gitconfig | Your user account |
| Local | –local | .git/config | One repository only |
Local overrides global, and global overrides system. Use local settings when, for example, you need a different work email for one repository.
Authentication
| Method | How it works | Notes |
| HTTPS + Personal Access Token (PAT) | Token replaces your password | Most platforms no longer accept account passwords for Git operations. Give tokens minimal scopes and expiry. |
| SSH keys | Public key on the server, private key on your machine | Very common in companies. Protect the private key with a passphrase. |
| Credential managers | Store tokens securely in the OS keychain | Git Credential Manager is bundled with Git for Windows and available for other platforms. |
Creating an SSH key:
ssh-keygen -t ed25519 -C “your@email.com”
eval “$(ssh-agent -s)”
ssh-add ~/.ssh/id_ed25519
cat ~/.ssh/id_ed25519.pub # copy this into GitHub/GitLab settings
ssh -T git@github.com
Hi username! You’ve successfully authenticated, but GitHub does not provide shell access.
Secure practices: never share the private key, never commit tokens, set token expiry, and revoke anything you suspect is exposed.
4. Essential Git Commands with Practical Examples
For each command: what it does, why you use it, an example and a common mistake.
Starting a repository
git init creates a new repository in the current folder.
mkdir shop-app && cd shop-app
git init
Initialized empty Git repository in /home/dev/shop-app/.git/
Use case: turning a new project into a tracked project. Mistake: running it inside another repository, creating a nested repo.
git clone <url> copies an existing repository, with full history.
git clone git@github.com:company/shop-app.git
Use case: joining a team project on day one. Mistake: cloning into the wrong folder.
Checking and staging
git status shows which files are modified, staged or untracked.
On branch main
Changes not staged for commit:
modified: login.py
Untracked files:
notes.txt
Run it constantly. It is the safest habit in Git.
git add <file> stages a file. git add . stages everything in the current directory and below.
Mistake: git add . can sweep in logs, .env files or build output. Check git status first and keep a good .gitignore.
Committing
git commit opens your editor for a message; git commit -m “message” commits inline.
git commit -m “Add email validation to login form”
[main 4f1a2bc] Add email validation to login form
1 file changed, 8 insertions(+)
Mistake: vague messages like “fix” or “update”. Write what changed and why.
Viewing history
git log shows history; git log –oneline shows one compact line per commit; git show displays one commit’s details.
git log –oneline –graph –decorate
4f1a2bc (HEAD -> main) Add email validation to login form
9c3d1e7 Create login page
Comparing
git diff compares working directory to staging area. git diff –staged compares staging area to the last commit.
Mistake: running git diff after git add and seeing nothing, then thinking changes vanished. They are staged, so use –staged.
Moving and removing files
git rm old_module.py # delete and stage the deletion
git rm –cached secrets.env # stop tracking but keep the file on disk
git mv utils.py helpers.py # rename and stage
Working with remotes
git remote add origin git@github.com:company/shop-app.git
git remote -v
origin git@github.com:company/shop-app.git (fetch)
origin git@github.com:company/shop-app.git (push)
git push origin main
git fetch origin
git pull origin main
git fetch vs git pull
| git fetch | git pull | |
| What it does | Downloads new commits and updates remote-tracking branches (like origin/main) | Fetch plus integrates the changes into your current branch |
| Changes your files? | No | Yes |
| Risk | Very low | Can cause conflicts immediately |
| Equivalent | git fetch then git merge (or git rebase with –rebase) |
Professionals often fetch first, inspect with git log HEAD..origin/main, and then decide how to integrate.
Stash, clean, tag, grep, blame
git stash # save uncommitted work and clean the directory
git stash list
git stash pop # re-apply the latest stash and remove it
git clean -n # dry run: show what would be deleted
git clean -fd # DANGEROUS: permanently deletes untracked files and directories
git tag v1.0.0
git tag -a v1.0.0 -m “First stable release”
git grep “calculate_tax” # search tracked files
git blame login.py # who last changed each line
Use case for blame: finding the commit (and the reason) behind a strange line. Use it to understand context, not to assign fault.
Warning: git clean -fd cannot be undone because untracked files were never saved in Git. Always run git clean -n first.
5. Git Branching and Branch Management
A branch is a lightweight pointer to a commit that lets you work on something in isolation. Developers create branches so unfinished work does not break the stable code.
Common branch types
| Type | Purpose | Example name |
| main (formerly master) | Stable, production-ready code | main |
| Development | Integration of upcoming work (Git Flow) | develop |
| Feature | One new feature | feature/user-login |
| Bug-fix | Non-urgent fix | bugfix/cart-total |
| Release | Final preparation of a release | release/2.4.0 |
| Hotfix | Urgent production fix | hotfix/payment-timeout |
Naming conventions: use lowercase, hyphens, a type prefix and, where your company uses one, a ticket ID, for example feature/SHOP-142-guest-checkout.
Commands
git branch # list local branches
git branch feature-login # create
git switch feature-login # move to it
git switch -c feature-payment # create and move
git branch -a # list local and remote-tracking
git branch -m old-name new-name # rename
git branch -d feature-login # delete (only if merged)
git branch -D feature-login # force delete (unmerged work may be lost)
git push -u origin feature-login # push and set upstream
Local, remote-tracking and upstream branches
- Local branch: feature-login, which you move by committing.
- Remote-tracking branch: origin/feature-login, a read-only bookmark of where the remote branch was at your last fetch.
- Upstream (tracking) branch: the remote branch your local branch is linked to, set with -u, so plain git push and git pull know where to go.
Example: five developers, one application
A team of five builds an online store. Priya builds login, Ravi builds the cart, Meena works on payments, Arjun fixes a search bug and Sana prepares the release.
gitGraph
commit id: “v1.0”
branch feature/login
branch feature/cart
branch feature/payment
checkout feature/login
commit id: “login UI”
checkout feature/cart
commit id: “cart API”
checkout feature/payment
commit id: “gateway”
checkout main
merge feature/login
merge feature/cart
merge feature/payment
Each person works without breaking the others. Their changes meet only when reviewed and merged. Conflicts will happen when two people touch the same code, which is exactly what sections 6 and 7 cover.
6. Git Merge and Merge Strategies
Merging combines the work from one branch into another. It is necessary because parallel work must eventually come back together.
Fast-forward merge
If main has no new commits since the feature branch was created, Git simply moves the main pointer forward. No merge commit is created.
git switch main
git merge feature-login
Updating 9c3d1e7..4f1a2bc
Fast-forward
login.py | 8 ++++++++
1 file changed, 8 insertions(+)
Three-way merge and merge commits
If both branches have new commits, Git finds the common ancestor and compares it with both tips (three points, hence “three-way”). It creates a merge commit with two parents.
Merge made by the ‘ort’ strategy.
(ort is the default merge strategy in modern Git.)
No-fast-forward merge
git merge –no-ff feature-login
Forces a merge commit even when fast-forward is possible. This preserves the fact that a feature branch existed.
Squash merge
git merge –squash feature-login
git commit -m “Add login feature”
Combines all branch changes into the working directory and staging area so you create one commit. Note that no merge relationship is recorded.
Aborting
Cancels an in-progress merge that has conflicts and restores the pre-merge state.
Comparison
| Strategy | Advantages | Disadvantages | Best for |
| Fast-forward | Linear, simple history | Loses the record of the branch | Small, short-lived changes |
| Three-way merge commit | Preserves true history | History can look busy | Long-running or shared branches |
| –no-ff | Clear feature grouping, easy to revert a whole feature | Extra merge commits | Git Flow, release tracking |
| –squash | Very clean main history | Loses individual commits and authorship detail | Messy branches with many WIP commits |
What happens internally
Git finds the merge base, computes the changes each side made since that base, applies both sets and, if they do not overlap, records a new commit with two parents. If they overlap on the same lines, it stops and asks you to decide. That is the next section.
7. Merge Conflicts: Complete Practical Guide
What is a merge conflict?
A merge conflict happens when Git cannot decide automatically how to combine changes because two branches modified the same part of the same file (or made incompatible changes) since their common ancestor.
When does Git merge automatically, and when does it need you?
| Situation | Result |
| Different files changed on each branch | Automatic merge |
| Same file, different regions changed | Automatic merge |
| Same lines changed differently | Conflict |
| One side deleted a file, the other modified it | Conflict |
| Both sides added a file with the same path but different content | Conflict |
Note that an automatic merge only means the text combined cleanly. It does not prove the combined logic is correct, so always run your tests.
Types of conflicts
| Type | Meaning |
| Same-line conflict | Both branches edited the same lines |
| Same-file conflict | Several separate regions of one file conflict |
| Delete vs modify | One branch deleted a file, the other changed it |
| Rename conflict | Both branches renamed the same file to different names, or one renamed and the other edited |
| Add/add | Both branches created the same filename independently |
| File mode conflict | Permission bits (such as the executable flag) changed differently |
| Binary conflict | Images, PDFs or compiled files cannot be merged line by line; you must choose one version |
Conflicts can also appear during git rebase (once per replayed commit) and git cherry-pick (when the picked commit does not apply cleanly).
A realistic example
The base login.py on main:
def login(username, password):
user = db.find_user(username)
if user and user.password == password:
return True
return False
Developer A (branch feature-login) fixes a security issue by hashing passwords:
def login(username, password):
user = db.find_user(username)
if user and verify_hash(password, user.password_hash):
return True
return False
Developer B (branch feature-lockout) adds an attempt limit:
def login(username, password):
user = db.find_user(username)
if user and user.failed_attempts >= 5:
return False
if user and user.password == password:
return True
return False
Both push their branches. A’s branch is merged into main first. When B merges main (or B’s branch is merged), Git reports:
Auto-merging login.py
CONFLICT (content): Merge conflict in login.py
Automatic merge failed; fix conflicts and then commit the result.
Reading the conflict markers
Open login.py:
def login(username, password):
user = db.find_user(username)
<<<<<<< HEAD
if user and user.failed_attempts >= 5:
return False
if user and user.password == password:
=======
if user and verify_hash(password, user.password_hash):
>>>>>>> feature-login
return True
return False
| Marker | Meaning |
| <<<<<<< HEAD | Start of the conflict. Lines below are from your current branch (the one you are merging into). |
| ======= | Divider between the two versions |
| >>>>>>> feature-login | End of the conflict. Lines above are from the incoming branch. |
Step-by-step resolution
Step 1. See what is conflicted.
You have unmerged paths.
(fix conflicts and run “git commit”)
Unmerged paths:
both modified: login.py
Step 2. Inspect the differences.
git diff # combined view of conflicts
git diff –ours # compare working file with your side
git diff –theirs # compare working file with incoming side
Step 3. Optionally use a merge tool (opens a visual three-pane editor such as VS Code, vimdiff or Meld if configured):
Step 4. Edit the file by hand. Do not just pick one side. Ask: what is each change trying to achieve? A’s change protects stored passwords. B’s change limits repeated guesses. The business needs both.
Resolved code:
def login(username, password):
user = db.find_user(username)
if user and user.failed_attempts >= 5:
return False
if user and verify_hash(password, user.password_hash):
return True
return False
Remove every marker line (<<<<<<<, =======, >>>>>>>).
Step 5. Test. Run unit tests. A clean-looking merge can still break logic (for example, B’s other code might still compare plain-text passwords somewhere else).
Step 6. Stage and commit.
git add login.py
git commit -m “Resolve merge conflict in login: combine hashing and lockout”
If you get stuck:
This returns you to the state before the merge started.
Key lesson: resolving a conflict is not choosing “mine” or “theirs”. It is understanding the intended behavior of both changes and producing code that preserves it. When unsure, talk to the other developer.
Quick options for whole-file decisions (use deliberately, especially for binary files):
git checkout –ours path/to/file
git checkout –theirs path/to/file
(Note: during a rebase, “ours” and “theirs” are reversed in meaning, which confuses many people.)
Preventing conflicts: pull or rebase often, keep branches short-lived, make small commits, avoid reformatting entire files, and talk to teammates working on the same area.
8. Git Rebase vs Git Merge
What is rebase?
git rebase takes the commits of your branch and replays them on top of another commit, usually the latest main. The result looks as if you started your work from the newest code.
gitGraph
commit id: “A”
commit id: “B”
branch feature
commit id: “F1”
commit id: “F2”
checkout main
commit id: “C”
commit id: “D”
Before rebase: feature branches from B. After git rebase main: F1 and F2 are re-created as F1′ and F2′ after D. They are new commits with new hashes.
git switch feature
git rebase main
Why use it, and what does “rewriting history” mean?
Rebase creates a linear history with no merge commits, which is easier to read and to bisect. But because it creates new commits and discards the old ones, it rewrites history. That is harmless on your private branch and harmful on a branch other people are using.
Golden rule: never rebase commits that have been pushed to a shared branch others build on.
Handling rebase conflicts
Conflicts may appear for each replayed commit. Resolve, stage, then continue:
git add login.py
git rebase –continue
git rebase –skip # drop the current commit entirely
git rebase –abort # go back to before the rebase
git pull –rebase fetches and then rebases your local commits on top of the remote branch, avoiding a needless merge commit.
Merge vs rebase
| Aspect | Merge | Rebase |
| History | Preserves true history, branch structure visible | Linear, rewritten |
| Merge commit | Yes (unless fast-forward) | No |
| Commit hashes | Unchanged | New hashes for replayed commits |
| Safety on shared branches | Safe | Risky; requires force push after rewrite |
| Conflict handling | Resolve once | May resolve repeatedly, once per commit |
| Best for | Integrating a finished feature into main | Updating your private feature branch with latest main |
| Example | git merge feature | git rebase main |
Practical rule used by many teams: rebase your own local feature branch onto main to stay current, then merge it (often via a pull request).
If you must push a rebased branch you own, prefer the safer option:
It refuses to overwrite remote commits you have not seen.
9. Git Reset, Revert and Restore
Beginners confuse these three. The key question is: what do you want to undo, and has it been shared?
git reset: move the branch pointer back
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. DANGEROUS
| Mode | Branch pointer | Staging area | Working directory |
| –soft | Moves | Unchanged | Unchanged |
| –mixed | Moves | Reset | Unchanged |
| –hard | Moves | Reset | Reset (changes discarded) |
Warning: git reset –hard permanently discards uncommitted changes. Committed work can often be recovered with git reflog, but uncommitted work cannot.
Scenario (local commit with wrong message or too many files):
git reset –soft HEAD~1
# fix, then
git commit -m “Correct message”
git revert: undo safely by adding a new commit
Revert creates a new commit that reverses the effect of an earlier one. History is preserved, so it is the safe choice for pushed or shared commits.
Scenario (bad change already in production):
git log –oneline
git revert 4f1a2bc
git push origin main
git restore: fix files
git restore filename.py # discard unstaged changes in the file (cannot be undone)
git restore –staged filename.py # unstage the file but keep your edits
Which one should I use?
| Goal | Command |
| Discard edits to a file | git restore file |
| Unstage a file | git restore –staged file |
| Undo local, unpushed commit | git reset |
| Undo pushed commit | git revert |
Troubleshooting example: you ran git reset –hard HEAD~3 by mistake. Run git reflog, find the commit you were on (for example HEAD@{1}), then git reset –hard HEAD@{1}.
10. Git Cherry-Pick and Stash
Cherry-pick
Cherry-picking applies the changes from one specific commit onto your current branch, creating a new commit.
git switch release/2.4
git cherry-pick 7d2e9ab
Companies use it for backporting: a bug fixed on main must also reach the supported release branch without bringing along unrelated work. If conflicts occur:
git add file.py
git cherry-pick –continue
git cherry-pick –abort
Caution: cherry-picked commits are duplicates with different hashes, so overuse can make history confusing.
Stash
Stash saves uncommitted work temporarily so you can switch context.
Scenario: you are halfway through a feature when production breaks.
git stash push -m “half-done cart discount”
git switch -c hotfix/payment-timeout main
# fix, commit, push
git switch feature/cart
git stash list
git stash apply # re-apply but keep the stash
git stash pop # re-apply and delete it
git stash drop stash@{0}
stash@{0}: On feature/cart: half-done cart discount
If applying a stash conflicts, resolve it like a merge conflict. The stash is kept when a pop conflicts, so nothing is lost. By default, git stash ignores untracked files; use git stash -u to include them.
11. GitHub, GitLab and Bitbucket
Git vs GitHub
Git is the version control tool that runs on your computer. GitHub, GitLab and Bitbucket are hosting platforms built around Git repositories. They add web interfaces, access control, collaboration and automation. Git works without any of them.
| Git (the tool) | Platform features (GitHub / GitLab / Bitbucket) | |
| Commits, branches, merges, rebase | Yes | Use Git underneath |
| Pull / Merge Requests | No | Platform feature |
| Code review comments | No | Platform feature |
| Branch protection, required checks | No | Platform feature |
| CI/CD pipelines | No | GitHub Actions, GitLab CI/CD, Bitbucket Pipelines |
| Issue tracking | No | Platform feature |
| Hosting remote repositories | No (any server can host) | Platform feature |
| Platform | Notes |
| GitHub | Largest open-source community; Pull Requests; GitHub Actions |
| GitLab | Built-in DevOps platform; calls them Merge Requests (MR); self-hosting is common |
| Bitbucket | Strong Jira integration; popular in Atlassian-based companies |
Key collaboration concepts
- Pull Request (PR) / Merge Request (MR): a request to merge your branch, with a discussion thread and review.
- Code review: teammates read the diff, comment and approve.
- Repository permissions: read, write, maintain, admin; give people the least access they need.
- Protected branches / branch protection rules: block direct pushes to main, require reviews and prevent force pushes.
- Required status checks: tests and linters must pass before merging.
- Code ownership (CODEOWNERS): automatically requests review from the owners of changed files.
- Forking: your own server-side copy of someone else’s repository, used for open-source contributions.
- Cloning: downloading a repository to your machine.
Open-source contribution flow
# 1. Fork on the website, then:
git clone git@github.com:yourname/project.git
cd project
git remote add upstream git@github.com:original/project.git
git switch -c fix/typo-in-readme
# edit, then
git add . && git commit -m “Fix typo in README”
git push -u origin fix/typo-in-readme
# 2. Open a Pull Request on the website
# Keep your fork current:
git fetch upstream && git merge upstream/main
12. Industry-Level Git Workflow
Common workflows
| Workflow | Idea | Best for |
| Git Flow | main, develop, feature, release and hotfix branches | Scheduled releases, versioned products |
| GitHub Flow | main is always deployable; short feature branches and PRs | Web apps with frequent deployment |
| Trunk-Based Development | Everyone integrates into main very frequently, often behind feature flags | Mature teams with strong CI |
| Feature Branch Workflow | One branch per feature, merged by PR | Most teams, general-purpose |
gitGraph
commit id: “v1.0”
branch develop
checkout develop
commit id: “dev work”
branch feature/cart
commit id: “cart”
checkout develop
merge feature/cart
branch release/1.1
commit id: “QA fixes”
checkout main
merge release/1.1 tag: “v1.1”
branch hotfix/crash
commit id: “urgent fix”
checkout main
merge hotfix/crash tag: “v1.1.1”
Enterprise example
Team: 1 Tech Lead, 2 Backend Developers (Asha, Ravi), 2 Frontend Developers (Meena, Karan), 1 QA Engineer (Sana), 1 DevOps Engineer (Dev). They use GitHub Flow with protected main, required reviews, CI checks and tagged releases.
Step 1: Setup (Tech Lead + DevOps). main is protected: no direct pushes, at least one approval, passing CI required, CODEOWNERS configured.
Step 2: Backend developer starts a ticket.
git switch main
git pull
git switch -c feature/SHOP-210-order-api
# write code and tests
git add .
git commit -m “Add order creation endpoint with validation”
git push -u origin feature/SHOP-210-order-api
Step 3: Pull request. Asha opens a PR. CI automatically runs unit tests, linting and security scans. The Tech Lead reviews and requests a change.
Step 4: Address review feedback.
# edit code
git add .
git commit -m “Handle empty cart in order endpoint”
git push
Step 5: Frontend integrates the API. Meena branches from latest main after the PR merges, or from Asha’s branch if coordinated:
git fetch origin
git switch -c feature/SHOP-211-order-ui origin/main
Step 6: Stay current and resolve conflicts.
git fetch origin
git rebase origin/main # only on your own unshared branch
# or: git merge origin/main
Step 7: Merge. After approval and green checks, the PR is merged (squash or merge commit, depending on team policy).
Step 8: QA. Sana tests the build deployed to a staging environment from main or a release candidate.
Step 9: Release and tagging (Tech Lead + DevOps).
git switch main
git pull
git tag -a v2.5.0 -m “Release 2.5.0: guest checkout and order API”
git push origin v2.5.0
The CI/CD pipeline builds the tagged commit, runs the full test suite and deploys to production.
Step 10: Production hotfix.
git switch -c hotfix/payment-timeout v2.5.0
# fix and test
git commit -am “Increase gateway timeout to 30s”
git push -u origin hotfix/payment-timeout
# PR to main, then tag v2.5.1 and deploy
Step 11: Rollback. If the new release causes serious issues, either redeploy the previous tag (v2.4.3) or revert the offending change:
git revert <commit-or-merge-commit> # for a merge commit add: -m 1
13. Common Git Errors and Their Solutions
Each entry lists the cause and fix. Run git status and git log –oneline –graph –all first when diagnosing.
Warning: commands marked ⚠ can destroy work. Read them twice and have a backup branch (git branch backup-before-fix) when unsure.
Setup and authentication
| # | Error | Cause | Solution | Prevention |
| 1 | fatal: not a git repository | You are outside a repo or .git is missing | cd into the project, or run git init / git clone | Check pwd; confirm with git status |
| 2 | Permission denied (publickey) | SSH key not added to the server or agent | ssh-add ~/.ssh/id_ed25519; add the .pub key to your account; test with ssh -T git@github.com | Use ssh -vT to debug; keep keys documented |
| 3 | Authentication failed | Wrong or expired token; password no longer accepted | Create a new PAT or use SSH; update the saved credential (git credential-manager or OS keychain) | Set token reminders; use a credential manager |
| 4 | remote origin already exists | git remote add origin run twice | git remote set-url origin <url> or git remote remove origin then add again | Check git remote -v first |
Push and pull problems
| # | Error | Cause | Solution | Prevention |
| 5 | failed to push some refs | Generic push failure: rejected update, permission or hook | Read the full message that follows; usually fix #6/#7 | Pull before push |
| 6 | Updates were rejected because the remote contains work that you do not have locally | Someone pushed first | git pull –rebase (or git pull), resolve conflicts, then push | Pull frequently |
| 7 | Non-fast-forward rejection | Your branch history diverged from remote | Integrate with git pull –rebase or merge. ⚠ Force push only on your own branch: git push –force-with-lease | Never force push shared branches |
| 11 | Your branch is behind ‘origin/main’ | Remote has new commits | git pull (or git merge –ff-only origin/main) | Fetch regularly |
| 12 | Your branch has diverged | Both local and remote have unique commits | git pull –rebase or git merge origin/main | Small, frequent syncs |
| 13 | cannot lock ref | A stale lock file, or a branch name conflict (e.g. feature and feature/x) | Ensure no other Git process is running; remove stale .git/*.lock only if sure; git remote prune origin | Avoid clashing branch names |
| 14 | refusing to merge unrelated histories | Merging two repos with no common ancestor | git pull origin main –allow-unrelated-histories after checking it is intended | Clone instead of re-initializing |
Working directory and branches
| # | Error | Cause | Solution | Prevention |
| 8 | Merge conflicts | Overlapping edits | See Section 7 | Short-lived branches |
| 9 | untracked working tree files would be overwritten by checkout | Untracked files clash with files in the target branch | Move or delete the files, or git stash -u, then switch | Commit or stash before switching |
| 10 | Detached HEAD | You checked out a commit, tag or remote branch directly | To keep work: git switch -c rescue-branch. To leave: git switch main | Use branches for work |
| 17 | Accidentally deleted a branch | git branch -D | git reflog, find the last commit, git branch restore-name <hash> | Prefer -d |
| 18 | Lost commits after reset | git reset –hard | git reflog then git reset –hard <hash> (reflog entries expire eventually, 90 days by default for reachable entries) | Create a backup branch first |
| 19 | Pushed to wrong branch | Wrong checkout | If private: reset the remote branch with –force-with-lease. If shared: git revert | Check git branch –show-current before push |
| 20 | Wrong commit message | Typo or missing detail | Unpushed: git commit –amend -m “New message”. Pushed: amend only if you own the branch and then force-with-lease | Use a commit template |
Security and big files
| # | Error | Cause | Solution | Prevention |
| 15 | Accidentally committed secrets | Keys in code or .env | Revoke and rotate the secret immediately, then remove it from history (git filter-repo) and force-push, informing the team (see Section 15) | Secret scanning, .gitignore, pre-commit hooks |
| 16 | Large file committed | Binary, dataset or build output | If unpushed: git rm –cached file, amend, add to .gitignore. If in history: git filter-repo –strip-blobs-bigger-than 50M (rewrites history) or migrate to Git LFS | Use LFS and .gitignore |
| 21 | Git LFS issues | LFS not installed or files appear as pointer text | git lfs install, then git lfs pull; check git lfs ls-files and .gitattributes | Document LFS setup |
Cross-platform and structure
| # | Error | Cause | Solution | Prevention |
| 22 | Case-sensitive filename conflicts | Windows/macOS file systems are often case-insensitive, Linux is not | Rename with git mv File.py file_tmp.py then git mv file_tmp.py file.py | Consistent lowercase naming |
| 23 | CRLF vs LF line endings | Windows vs Unix | Windows: git config –global core.autocrlf true; Linux/macOS: input. Better: commit a .gitattributes with * text=auto | Use .gitattributes |
| 24 | Submodule not initialized | Cloned without submodules | git submodule update –init –recursive or clone with –recurse-submodules | Document in README |
| 25 | Rebase conflicts | Overlapping edits during replay | Fix, git add, git rebase –continue; or git rebase –abort | Rebase often, in small steps |
| 26 | Cherry-pick conflicts | Target branch differs from source | Fix, git add, git cherry-pick –continue or –abort | Pick small, self-contained commits |
| 27 | Shallow clone limits | –depth clones lack full history | git fetch –unshallow | Use shallow only in CI |
| 28 | Repository corruption | Disk failure, interrupted operation | git fsck to diagnose. Fetch missing objects from the remote; as a last resort, re-clone and copy over unpushed work | Push regularly; back up |
Handy diagnostic commands
git status
git log –oneline –graph –all –decorate
git reflog
git remote -v
git config –list –show-origin
git fsck
14. Advanced Git Concepts Used in Industry
| Concept | What it does | Where it is useful |
| Interactive rebase (git rebase -i HEAD~4) | Reorder, edit, drop or combine recent commits | Cleaning a messy branch before a PR |
| Squashing | Combine several commits into one (squash in interactive rebase or merge –squash) | Keeping main history tidy |
| Amend (git commit –amend) | Modify the last commit | Fixing a typo or adding a forgotten file (unpushed only) |
| Reflog (git reflog) | Local log of where HEAD and branches have been | Recovering “lost” commits |
| Bisect (git bisect start / bad / good) | Binary search through history to find the commit that introduced a bug | Hunting regressions in large histories |
| Blame (git blame -L 10,20 file) | Shows who last changed each line | Understanding why code exists |
| Hooks (.git/hooks) | Scripts that run at Git events | Enforcing checks locally |
| Pre-commit hooks | Run linters, formatters or secret scans before a commit is created | Catching problems early (often managed with the pre-commit framework) |
| Commit signing / GPG (git commit -S) | Cryptographically proves who made the commit (GPG, SSH or S/MIME signing) | Regulated or high-trust projects |
| Signed tags (git tag -s v1.0 -m “…”) | Proves a release tag is authentic | Release integrity |
| Submodules | Embed another repository at a pinned commit | Shared libraries across projects |
| Worktrees (git worktree add ../hotfix main) | Multiple working directories from one repository | Working on a hotfix without stashing |
| Git LFS | Stores large binaries outside the main repo, keeping pointers | Design assets, models, datasets |
| Sparse checkout | Check out only some directories | Huge monorepos |
| Partial clone (–filter=blob:none) | Download objects on demand | Speeding up cloning large repos |
| Shallow clone (–depth 1) | Only recent history | CI pipelines |
| .gitignore | Lists files Git should not track | Keeping logs, builds and secrets out |
| .gitattributes | Per-path settings: line endings, LFS, diff behavior | Cross-platform teams |
| Aliases | Shortcuts for commands | Daily productivity |
| Maintenance / garbage collection (git gc, git maintenance) | Compresses and cleans objects | Large, long-lived repos |
| Bundles (git bundle create repo.bundle –all) | Package a repository into one file | Offline or air-gapped transfer |
| Rerere (git config rerere.enabled true) | “Reuse recorded resolution” remembers how you resolved a conflict | Long-lived branches that are rebased repeatedly |
Examples
# Interactive rebase of the last 3 commits
git rebase -i HEAD~3
# Find the bad commit with bisect
git bisect start
git bisect bad # current version is broken
git bisect good v2.4.0 # this older tag worked
# Git checks out midpoints; test each, then mark good or bad
git bisect reset
# A useful alias
git config –global alias.lg “log –oneline –graph –decorate –all”
A sample .gitignore for a Python project:
__pycache__/
*.pyc
.venv/
.env
*.log
.idea/
.vscode/
Reminder: .gitignore does not affect files that are already tracked. Use git rm –cached <file> to stop tracking them.
15. Git Security and Best Practices
- Never commit passwords, tokens or API keys. Use environment variables or a secrets manager.
- Use secret scanning (platform features and tools such as pre-commit scanners) to catch leaks early.
- Use SSH keys securely: passphrase-protected, one per device, removed when a device is retired.
- Sign commits when required by your organization.
- Protect main branches and require pull requests.
- Require code reviews and passing status checks.
- Follow least-privilege access and audit repository access periodically.
- Avoid force pushing shared branches. If you must, use –force-with-lease and tell the team.
- Write meaningful commit messages and keep commits small and focused.
- Maintain a proper .gitignore.
Good commit message format
Add rate limiting to login endpoint
Limit to 5 failed attempts per 15 minutes per IP to reduce
brute-force attacks. Closes SHOP-318.
Deleting a secret in a later commit does not remove it
Git keeps full history. If you commit an API key and then delete it in the next commit, anyone with access to the repository (or a clone) can still read it from the earlier commit.
What to do if a credential is exposed
- Revoke or rotate the credential immediately. Do this first, because history cleanup takes time and clones may already exist.
- Assess exposure: was the repo public? Check access logs of the affected service for misuse.
- Remove it from history if appropriate, using git filter-repo (or BFG Repo-Cleaner), then force-push and ask everyone to re-clone or reset their local copies.
- Coordinate rotation: update the secret in the secrets manager and deployment configs, redeploy services, confirm old keys are disabled and notify the security team.
- Prevent recurrence: add secret scanning, a pre-commit hook and a .gitignore entry, and write a short post-incident note.
Cleaning history helps, but rotation is what actually secures you. Treat any committed secret as compromised.
16. Real-World Industry Projects
1. E-commerce application
- Git use: one repository for storefront, or separate frontend and API repos.
- Branching: GitHub Flow with feature/SHOP-###-name; hotfix/ for urgent fixes.
- Collaboration and PRs: each ticket maps to a branch and PR; review by a teammate and the owner of that module.
- Conflict scenario: two developers change the price calculation function (one adds discounts, one adds tax). Resolution requires understanding order of operations: discount first, then tax.
- Testing and deployment: CI runs unit and integration tests; merges to main deploy to staging; tagged releases go to production, avoiding peak sale hours.
- Production issue: checkout fails after release. Team reverts the merge commit, redeploys, then fixes properly on a hotfix branch.
2. Banking application
- Git use: strict access control, signed commits and tags, audit trails.
- Branching: release branches with formal approvals; main protected with multiple required reviewers.
- PR process: two approvals plus security review; CODEOWNERS for sensitive modules.
- Conflict scenario: two changes to interest calculation rules. Resolved only with business analyst confirmation and extensive tests.
- Testing and deployment: automated compliance and security scans, manual QA sign-off, change-approval records.
- Production issue: hotfix branch from the release tag, cherry-picked into the next release branch, with every step documented.
3. Microservices
- Git use: repository per service (or a monorepo with path-based ownership).
- Branching: trunk-based with feature flags to avoid long-lived branches.
- PR process: small PRs; API contract tests verify compatibility between services.
- Conflict scenario: shared API schema file edited by two teams. Resolve through a versioned contract and communication.
- Testing and deployment: each service has its own pipeline; independent versioned tags.
- Production issue: roll back just the faulty service by deploying its previous tag.
4. DevOps and Infrastructure-as-Code
- Git use: Terraform, Kubernetes manifests and pipeline definitions stored in Git; Git becomes the source of truth (GitOps).
- Branching: feature branches; PRs show a plan or diff of infrastructure changes.
- Conflict scenario: two engineers edit the same Terraform file. Resolve carefully and re-run the plan, since an incorrect merge can change real infrastructure.
- Testing and deployment: validation, policy checks and plan review before merge; automated apply after approval.
- Production issue: git revert the change and let the pipeline restore the previous state.
5. Open-source contribution
- Git use: fork, clone, branch, push, PR.
- Branching: one small branch per contribution; keep your fork synced with upstream.
- PR process: follow CONTRIBUTING.md, write clear descriptions, respond to maintainer feedback and expect to rebase.
- Conflict scenario: the project moved on while your PR waited. Rebase on upstream/main, resolve conflicts and force-push to your own PR branch with –force-with-lease.
- Testing: the project’s CI runs on your PR.
17. The Human Impact of Git in Software Development
Git is a technical tool, but its biggest effects are human.
It reduces stress. Knowing that every commit is a saved checkpoint changes how you work. You stop fearing the next edit, because a known good state is one command away.
It protects against accidental loss. Laptops fail, files get overwritten and late-night mistakes happen. A pushed commit is a copy on another machine.
It improves teamwork. Branches let people work in parallel without stepping on each other. Pull requests turn “I changed something” into a conversation.
It helps juniors learn. A new developer can read history to see how a senior solved a problem, line by line, with the reasoning in the commit message. Code review comments become a free mentoring session.
It encourages accountability. git blame and history show who changed what and when. Used well, this is about context and learning, not blame. Teams do best when the question is “why did this change?” instead of “who broke it?”
It makes remote collaboration possible. Developers across time zones can contribute to one codebase without ever being in the same room.
It helps teams recover. Revert, reflog and tags turn a disaster into an inconvenience.
It reduces misunderstandings. A diff is precise. “I changed the login” is vague; a 12-line diff is not.
It encourages experimentation. Branches are cheap, so trying a risky idea costs almost nothing. If it fails, delete the branch.
A story: Priya, Arjun and the conflicting login
Priya and Arjun were two developers on the same product team. On Monday, Priya started improving the login screen’s error messages. Arjun, working on a security ticket, was changing the same function to add an account lockout.
Both finished on Thursday. Priya’s pull request merged first. When Arjun pulled the latest main, Git stopped with a conflict in login.py. His first reaction was a sinking feeling, because he had a demo the next morning.
He was tempted to keep his version and discard hers. Instead, he opened the conflict and read her change. Then he messaged her: “We both edited login(). Can you walk me through what the new error messages are for?”
Ten minutes on a call later, they understood each other’s intent. Her messages depended on returning a specific reason when credentials failed; his lockout needed to return a different reason after five attempts. Together they wrote one version that did both, ran the tests, and found that one of his tests failed because her messages changed a string. They fixed it together.
The merge commit said: “Resolve login conflict: combine lockout with clearer error messages.” The demo went fine. More importantly, Arjun now knew how the error-handling module worked, and Priya knew the security requirements behind the lockout.
Git did not resolve the problem for them. It simply stopped them from silently breaking each other’s work, showed exactly where the overlap was and gave them a reason to talk. That is what good tools do: they do not replace teamwork, they make it harder to skip.
18. Git Interview Questions and Answers
Beginner (10)
1. What is Git? A free, open-source distributed version control system that tracks changes, supports branching and merging, and lets teams collaborate.
2. What is the difference between Git and GitHub? Git is the version control tool. GitHub is a hosting platform for Git repositories that adds pull requests, reviews, issues and CI/CD.
3. What is a repository? A project folder tracked by Git, containing a .git directory with the full history and metadata.
4. What is the staging area? A place where you prepare the exact changes for the next commit. git add moves changes into it.
5. What is the difference between git add and git commit? git add stages changes; git commit records the staged snapshot permanently in the local repository.
6. What is a branch? A lightweight movable pointer to a commit, used to develop features in isolation.
7. What does git clone do? Copies a remote repository, including all history, to your machine and sets up origin.
8. What is git status used for? It shows modified, staged and untracked files and the current branch’s relationship to its upstream.
9. What is .gitignore? A file listing patterns of files Git should not track, such as logs, build output and secrets files.
10. Difference between git fetch and git pull? fetch downloads remote changes without changing your working files. pull fetches and then merges (or rebases) them into your current branch.
Intermediate (10)
11. What is a merge conflict and how do you resolve it? It occurs when Git cannot automatically combine changes to the same lines. Open the file, understand both intents, edit to the correct combined result, remove markers, run tests, git add, then commit. git merge –abort cancels.
12. Merge vs rebase? Merge preserves history and adds a merge commit. Rebase replays commits on a new base for a linear history but rewrites commits, so it should not be used on shared branches.
13. Reset vs revert? Reset moves the branch pointer (rewriting history); revert adds a new commit that undoes a previous one. Use revert for pushed commits.
14. Explain soft, mixed and hard reset. Soft keeps changes staged. Mixed (default) keeps them in the working directory but unstaged. Hard discards them.
15. What is cherry-pick? Applying a specific commit from another branch onto the current one, commonly for backporting fixes.
16. What is git stash? Temporarily shelves uncommitted changes so you can switch tasks; restore with git stash pop or apply.
17. What is a detached HEAD? HEAD points directly to a commit instead of a branch. Commits made there can be lost unless you create a branch (git switch -c name).
18. What is a fast-forward merge? When the target branch has no new commits, Git just moves its pointer forward with no merge commit.
19. What is a pull request? A platform feature (not Git itself) to propose merging a branch, enabling review, discussion and automated checks.
20. How do you undo git add? git restore –staged <file> (older Git: git reset HEAD <file>).
Advanced and scenario-based (5)
21. Scenario: a bug reached production after a merge. What do you do? If the branch is shared, git revert the merge commit (git revert -m 1 <merge-hash>), push, deploy and then fix properly on a hotfix branch. Avoid rewriting main.
22. Scenario: you ran git reset –hard and lost commits. Use git reflog to find the previous HEAD, then git reset –hard <hash> or create a branch at that hash.
23. Scenario: a hotfix on main must also go into release/2.4. Find the commit hash and run git switch release/2.4 followed by git cherry-pick <hash>, resolving conflicts if any.
24. Scenario: your rebase hits repeated conflicts and you are lost. Run git rebase –abort to return to the original state, then consider merging instead, or squashing commits first to reduce repeated conflicts.
25. How would you find which commit introduced a bug? Use git bisect: mark the current commit bad and a known old one good; Git binary-searches history until it identifies the first bad commit. Test each step, then git bisect reset.
19. Git Command Cheat Sheet
| Command | Purpose | When to use | Risk |
| git init | Create a repository | Starting a project | Low |
| git clone <url> | Copy a remote repo | Joining a project | Low |
| git status | Show state | Constantly | None |
| git add <file> | Stage changes | Before committing | Low |
| git commit -m “msg” | Save a snapshot | After a logical change | Low |
| git log –oneline –graph | View history | Understanding changes | None |
| git diff / –staged | Compare changes | Before staging/committing | None |
| git fetch | Download remote changes | Before integrating | None |
| git pull | Fetch and integrate | Updating your branch | Medium (can conflict) |
| git push | Upload commits | Sharing work | Medium |
| git switch -c <name> | New branch | Starting a feature | Low |
| git branch -d <name> | Delete merged branch | Cleanup | Low |
| git branch -D <name> | Force-delete branch | Abandoning work | High |
| git merge <branch> | Combine branches | Finishing a feature | Medium |
| git merge –abort | Cancel conflicted merge | Merge went wrong | Low |
| git rebase <base> | Replay commits | Updating private branch | High if shared |
| git cherry-pick <hash> | Copy one commit | Backporting | Medium |
| git stash / pop | Shelve and restore work | Switching tasks | Low |
| git restore <file> | Discard file edits | Reverting local changes | High (unrecoverable) |
| git restore –staged <file> | Unstage | Fixing staging | Low |
| git reset –soft/–mixed | Undo commits, keep changes | Local cleanup | Medium |
| git reset –hard | Undo and discard changes | Last resort | Very high |
| git revert <hash> | Undo via new commit | Fixing shared history | Low |
| git clean -fd | Delete untracked files | Cleaning workspace | Very high |
| git push –force-with-lease | Safer force push | After rebasing own branch | High |
| git reflog | Recover lost commits | After mistakes | None |
| git tag -a v1.0 -m “…” | Mark a release | Releasing | Low |
| git bisect | Find bug-introducing commit | Regressions | Low |
| git blame <file> | See line authorship | Understanding context | None |
Frequently Asked Questions
1. What is Git used for? Tracking changes to code and files, collaborating with others through branches and merges, and recovering earlier versions.
2. Is Git difficult to learn for beginners? The daily basics (status, add, commit, push, pull, switch) can be learned in a few days. Rebase, reflog and conflict handling come with practice.
3. What is the difference between Git and GitHub? Git is the tool; GitHub is an online service that hosts Git repositories and adds collaboration features.
4. Do I need GitHub to use Git? No. Git works fully offline. GitHub, GitLab and Bitbucket are optional hosting platforms.
5. How do I fix a merge conflict in Git? Open the conflicted file, understand both changes, edit to the correct combined result, remove markers, test, git add and commit.
6. Should I use merge or rebase? Use merge for shared branches and finished features; use rebase to tidy and update your own private branch. Follow your team’s policy.
7. How do I undo my last commit? Local: git reset –soft HEAD~1. Already pushed to a shared branch: git revert HEAD.
8. Can I recover deleted commits or branches? Often yes, using git reflog, until the entries expire and garbage collection removes unreachable objects.
9. What is the best Git workflow for a team? It depends: GitHub Flow for continuous delivery, Git Flow for scheduled releases, trunk-based for mature CI. Many teams use feature branches with pull requests.
10. How can I practice Git? Create small projects, deliberately create and resolve conflicts, contribute to an open-source repository and try an interactive Git tutorial.
Conclusion
Git is not just a way to save code. It is a safety net that lets you experiment without fear, a collaboration system that lets many people build one product, an accountability trail that records what changed and why, and a delivery backbone that connects code to testing and production.
It will not guarantee your code is correct, stop every mistake or resolve every conflict for you. What it does is make mistakes visible and recoverable, and make teamwork structured instead of chaotic.
If you are a student, fresher, developer or DevOps engineer, the way to learn Git is to use it on real work. Start a repository today. Make small commits. Create a branch for every feature. Break something on purpose and recover it with reflog. Open a pull request, even to your own project. Contribute a small fix to an open-source repository. After a few weeks, commands that looked intimidating become habit, and you will understand why nearly every software team depends on this tool.
Official References and Further Learning
- Pro Git book (free): git-scm.com/book
- Git reference documentation: git-scm.com/docs
- Git downloads: git-scm.com/downloads
- GitHub Docs: docs.github.com
- GitLab Docs: docs.gitlab.com
- Bitbucket documentation: support.atlassian.com/bitbucket-cloud
- Atlassian Git tutorials: atlassian.com/git/tutorials
- Git LFS: git-lfs.com
- git-filter-repo: github.com/newren/git-filter-repo
- Interactive practice: learngitbranching.js.org
Stay Tuned: zixyi.com