<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Git &#8211; Bits of .NET</title>
	<atom:link href="http://blog.ercanopak.com/category/git/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ercanopak.com</link>
	<description>Daily micro-tips for C#, SQL, performance, and scalable backend engineering.</description>
	<lastBuildDate>Mon, 30 Mar 2026 17:51:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>http://blog.ercanopak.com/wp-content/uploads/2018/06/cropped-EO_LOGO_32-32x32.png</url>
	<title>Git &#8211; Bits of .NET</title>
	<link>http://blog.ercanopak.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Git: Use Cherry-Pick to Apply Specific Commits Across Branches</title>
		<link>http://blog.ercanopak.com/git-use-cherry-pick-to-apply-specific-commits-across-branches/</link>
					<comments>http://blog.ercanopak.com/git-use-cherry-pick-to-apply-specific-commits-across-branches/#respond</comments>
		
		<dc:creator><![CDATA[ErcanOPAK]]></dc:creator>
		<pubDate>Mon, 30 Mar 2026 17:51:27 +0000</pubDate>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[branching]]></category>
		<category><![CDATA[Cherry Pick]]></category>
		<category><![CDATA[Code Management]]></category>
		<category><![CDATA[Git Commands]]></category>
		<category><![CDATA[Git Tips]]></category>
		<category><![CDATA[Git Workflow]]></category>
		<category><![CDATA[Hotfix]]></category>
		<category><![CDATA[Version Control]]></category>
		<guid isPermaLink="false">http://blog.ercanopak.com/git-use-cherry-pick-to-apply-specific-commits-across-branches/</guid>

					<description><![CDATA[🍒 Pick Commits Like Cherries Need one commit from another branch? Don&#8217;t merge everything. Cherry-pick copies specific commits to your current branch. Surgical precision. The Problem # Scenario: Bug fix on wrong branch git branch * feature-login main hotfix # You committed bug fix to feature-login # But it needs to be on hotfix branch [&#8230;]]]></description>
										<content:encoded><![CDATA[<div style="background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); color: white; padding: 50px 40px; border-radius: 16px; margin: 40px 0; box-shadow: 0 20px 60px rgba(0,0,0,0.3);">
<h2 style="margin: 0 0 20px 0; font-size: 2.8em; font-weight: 800; line-height: 1.2;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f352.png" alt="🍒" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Pick Commits Like Cherries</h2>
<p style="font-size: 1.4em; line-height: 1.8; margin: 0; opacity: 0.95;">Need one commit from another branch? Don&#8217;t merge everything. <strong>Cherry-pick</strong> copies specific commits to your current branch. Surgical precision.</p>
</p></div>
<h3 style="color: #2c3e50; font-size: 2.2em; margin: 50px 0 30px 0; font-weight: 700; border-left: 5px solid #00f2fe; padding-left: 20px;">The Problem</h3>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">
# Scenario: Bug fix on wrong branch
git branch
* feature-login
  main
  hotfix

# You committed bug fix to feature-login
# But it needs to be on hotfix branch too!

git log --oneline
a1b2c3d Fix critical security bug  ← Need this on hotfix!
d4e5f6g Add login form
g7h8i9j Update styles

# Don't want to merge entire feature branch
# Just need the security fix
</pre>
<h3 style="color: #2c3e50; font-size: 2.2em; margin: 50px 0 30px 0; font-weight: 700; border-left: 5px solid #27ae60; padding-left: 20px;">Cherry-Pick Solution</h3>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">
# Switch to target branch
git checkout hotfix

# Cherry-pick the commit
git cherry-pick a1b2c3d

# Done! Commit copied to hotfix branch
git log --oneline
a1b2c3d Fix critical security bug  ← Same commit, now on hotfix!
x7y8z9a Previous hotfix commit
</pre>
<div style="background: #f8f9fa; padding: 40px; border-radius: 12px; margin: 40px 0; border: 2px solid #4facfe;">
<h4 style="color: #00f2fe; margin-top: 0; font-size: 1.7em; font-weight: 700;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f3af.png" alt="🎯" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Common Use Cases</h4>
<h5 style="color: #667eea; font-size: 1.4em; margin: 25px 0 15px 0;">1. Bug Fix on Wrong Branch</h5>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">
# Fixed bug on feature branch, need on main
git checkout main
git cherry-pick abc123

# Or cherry-pick from another person's branch
git cherry-pick origin/their-branch-name~2  # 2 commits ago
</pre>
<h5 style="color: #667eea; font-size: 1.4em; margin: 25px 0 15px 0;">2. Apply Multiple Commits</h5>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">
# Cherry-pick range of commits
git cherry-pick abc123..def456

# Cherry-pick multiple specific commits
git cherry-pick abc123 def456 ghi789

# Cherry-pick all commits from another branch
git cherry-pick feature-branch
</pre>
<h5 style="color: #667eea; font-size: 1.4em; margin: 25px 0 15px 0;">3. Hotfix to Multiple Versions</h5>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">
# Apply same fix to v1.0, v2.0, v3.0 branches
git checkout v1.0-stable
git cherry-pick abc123

git checkout v2.0-stable
git cherry-pick abc123

git checkout v3.0-stable
git cherry-pick abc123

# Same fix on all versions!
</pre>
</p></div>
<h3 style="color: #2c3e50; font-size: 2.2em; margin: 50px 0 30px 0; font-weight: 700; border-left: 5px solid #f39c12; padding-left: 20px;">Handle Conflicts</h3>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">
git cherry-pick abc123

# If conflicts:
# CONFLICT (content): Merge conflict in file.js

# Fix conflicts
vim file.js  # Resolve conflicts

# Mark as resolved
git add file.js

# Continue cherry-pick
git cherry-pick --continue

# Or abort
git cherry-pick --abort
</pre>
<div style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 35px; border-radius: 12px; margin: 40px 0;">
<h4 style="margin-top: 0; font-size: 1.7em; font-weight: 700;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f527.png" alt="🔧" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Advanced Options</h4>
<pre style="background: rgba(0,0,0,0.3); color: #fff; padding: 25px; border-radius: 8px; font-size: 1.05em; line-height: 1.8;">
# Cherry-pick without committing (stage changes only)
git cherry-pick -n abc123
# Make modifications, then commit manually

# Cherry-pick and edit commit message
git cherry-pick -e abc123

# Add 'cherry picked from' note to commit message
git cherry-pick -x abc123
# Adds: (cherry picked from commit abc123)

# Cherry-pick but with different author
git cherry-pick abc123
git commit --amend --author="John Doe <john@example.com>"

# Cherry-pick only the changes, not the commit
git cherry-pick -n abc123
git reset  # Unstage
# Now you have changes in working directory
</pre>
</p></div>
<h3 style="color: #2c3e50; font-size: 2.2em; margin: 50px 0 30px 0; font-weight: 700; border-left: 5px solid #667eea; padding-left: 20px;">Real-World Workflow</h3>
<div style="background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); color: white; padding: 35px; border-radius: 12px; margin: 40px 0;">
<h4 style="margin-top: 0; font-size: 1.7em; font-weight: 700;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4cb.png" alt="📋" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Production Hotfix Workflow</h4>
<pre style="background: rgba(0,0,0,0.3); color: #fff; padding: 25px; border-radius: 8px; font-size: 1.05em; line-height: 1.8;">
# Bug found in production!
# Create hotfix branch from main
git checkout main
git checkout -b hotfix-critical-bug

# Fix bug, commit
git commit -m "Fix critical login bug"
# Commit hash: xyz789

# Deploy hotfix to production
git checkout main
git merge hotfix-critical-bug
git push

# Now cherry-pick to development branch
git checkout develop
git cherry-pick xyz789

# Now cherry-pick to all active feature branches
git checkout feature-new-ui
git cherry-pick xyz789

git checkout feature-api-v2
git cherry-pick xyz789

# Same fix everywhere!
</pre>
</p></div>
<div style="background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%); padding: 35px; border-radius: 12px; margin: 40px 0; border-left: 5px solid #28a745;">
<h4 style="color: #155724; margin-top: 0; font-size: 1.7em; font-weight: 700;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> When to Use Cherry-Pick</h4>
<ul style="color: #155724; font-size: 1.15em; line-height: 2.2; margin: 20px 0;">
<li><strong>Bug fixes:</strong> Apply to multiple branches/versions</li>
<li><strong>Backporting:</strong> Bring new features to old versions</li>
<li><strong>Mistakes:</strong> Commit on wrong branch, move it</li>
<li><strong>Selective merging:</strong> Want some commits, not all</li>
<li><strong>Team collaboration:</strong> Grab colleague&#8217;s commit</li>
</ul></div>
<div style="background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%); border-left: 5px solid #ffc107; padding: 35px; margin: 50px 0; border-radius: 12px;">
<h4 style="color: #856404; margin-top: 0; font-size: 1.7em; font-weight: 700;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/26a0.png" alt="⚠" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Caveats</h4>
<ul style="color: #856404; font-size: 1.15em; line-height: 2.2; margin: 20px 0;">
<li><strong>Creates duplicate commits:</strong> Same change, different hash</li>
<li><strong>Can cause conflicts:</strong> If code has diverged</li>
<li><strong>Loses context:</strong> Commit might not make sense alone</li>
<li><strong>Tracking is harder:</strong> Git doesn&#8217;t track cherry-picks automatically</li>
<li><strong>Prefer merge when possible:</strong> Cherry-pick is for exceptions</li>
</ul></div>
<div style="background: #f8f9fa; padding: 40px; border-radius: 12px; margin: 40px 0; border: 2px solid #4facfe;">
<h4 style="color: #00f2fe; margin-top: 0; font-size: 1.7em; font-weight: 700;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4a1.png" alt="💡" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Pro Tips</h4>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">
# Find commits to cherry-pick
git log --oneline --graph branch-name

# Cherry-pick from reflog (even deleted commits!)
git reflog
git cherry-pick abc123

# Test before cherry-picking
git show abc123  # View commit changes

# Cherry-pick merge commit (requires -m)
git cherry-pick -m 1 merge-commit-hash
# -m 1 means use first parent

# Undo cherry-pick
git reset --hard HEAD~1  # If not pushed
git revert commit-hash   # If already pushed
</pre>
</p></div>
<div style="background: #f8f9fa; padding: 40px; border-radius: 12px; margin: 40px 0; border: 2px solid #4facfe;">
<h4 style="color: #00f2fe; margin-top: 0; font-size: 1.7em; font-weight: 700;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f3af.png" alt="🎯" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Cheat Sheet</h4>
<table style="width: 100%; border-collapse: collapse; margin: 20px 0;">
<tr style="background: #4facfe; color: white;">
<th style="padding: 15px; text-align: left;">Command</th>
<th style="padding: 15px; text-align: left;">Action</th>
</tr>
<tr>
<td style="padding: 12px; border-bottom: 1px solid #ddd;"><code>git cherry-pick abc123</code></td>
<td style="padding: 12px; border-bottom: 1px solid #ddd;">Apply single commit</td>
</tr>
<tr style="background: #f8f9fa;">
<td style="padding: 12px; border-bottom: 1px solid #ddd;"><code>git cherry-pick abc..def</code></td>
<td style="padding: 12px; border-bottom: 1px solid #ddd;">Apply range of commits</td>
</tr>
<tr>
<td style="padding: 12px; border-bottom: 1px solid #ddd;"><code>git cherry-pick -n abc123</code></td>
<td style="padding: 12px; border-bottom: 1px solid #ddd;">Don&#8217;t commit (stage only)</td>
</tr>
<tr style="background: #f8f9fa;">
<td style="padding: 12px; border-bottom: 1px solid #ddd;"><code>git cherry-pick -x abc123</code></td>
<td style="padding: 12px; border-bottom: 1px solid #ddd;">Add source note to message</td>
</tr>
<tr>
<td style="padding: 12px; border-bottom: 1px solid #ddd;"><code>git cherry-pick --continue</code></td>
<td style="padding: 12px; border-bottom: 1px solid #ddd;">Continue after conflict</td>
</tr>
<tr style="background: #f8f9fa;">
<td style="padding: 12px;"><code>git cherry-pick --abort</code></td>
<td style="padding: 12px;">Cancel cherry-pick</td>
</tr>
</table></div>
<blockquote style="background: linear-gradient(to right, #e0f7fa, #b2ebf2); border-left: 6px solid #00bcd4; padding: 40px; margin: 50px 0; border-radius: 12px;">
<p style="font-size: 1.5em; line-height: 1.9; margin: 0; color: #006064; font-style: italic; font-weight: 500;">&#8220;Critical security fix needed in 3 production versions simultaneously. Cherry-picked same commit to v1, v2, v3 branches. All versions patched in 10 minutes. Cherry-pick saved the day.&#8221;</p>
<footer style="margin-top: 20px; color: #00838f; font-size: 1.15em; font-weight: 600;">— DevOps Engineer</footer>
</blockquote>
]]></content:encoded>
					
					<wfw:commentRss>http://blog.ercanopak.com/git-use-cherry-pick-to-apply-specific-commits-across-branches/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Git: Use Interactive Rebase to Clean Up Commit History Before Merge</title>
		<link>http://blog.ercanopak.com/git-use-interactive-rebase-to-clean-up-commit-history-before-merge/</link>
					<comments>http://blog.ercanopak.com/git-use-interactive-rebase-to-clean-up-commit-history-before-merge/#respond</comments>
		
		<dc:creator><![CDATA[ErcanOPAK]]></dc:creator>
		<pubDate>Mon, 30 Mar 2026 17:51:20 +0000</pubDate>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Code Review]]></category>
		<category><![CDATA[Git History]]></category>
		<category><![CDATA[Git Rebase]]></category>
		<category><![CDATA[Git Tips]]></category>
		<category><![CDATA[Git Workflow]]></category>
		<category><![CDATA[Interactive Rebase]]></category>
		<category><![CDATA[Squash Commits]]></category>
		<category><![CDATA[Version Control]]></category>
		<guid isPermaLink="false">http://blog.ercanopak.com/git-use-interactive-rebase-to-clean-up-commit-history-before-merge/</guid>

					<description><![CDATA[🔧 Rewrite Git History 50 commits saying &#8216;fix typo&#8217;, &#8216;WIP&#8217;, &#8216;oops&#8217;? Messy history before PR? Interactive rebase lets you squash, reword, reorder commits. Clean history like a pro. The Messy History Problem git log --oneline a1b2c3d fix typo d4e5f6g WIP g7h8i9j oops forgot file j1k2l3m fix typo again m4n5o6p actually fix the bug p7q8r9s Add [&#8230;]]]></description>
										<content:encoded><![CDATA[<div style="background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); color: white; padding: 50px 40px; border-radius: 16px; margin: 40px 0; box-shadow: 0 20px 60px rgba(0,0,0,0.3);">
<h2 style="margin: 0 0 20px 0; font-size: 2.8em; font-weight: 800; line-height: 1.2;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f527.png" alt="🔧" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Rewrite Git History</h2>
<p style="font-size: 1.4em; line-height: 1.8; margin: 0; opacity: 0.95;">50 commits saying &#8216;fix typo&#8217;, &#8216;WIP&#8217;, &#8216;oops&#8217;? Messy history before PR? <strong>Interactive rebase</strong> lets you squash, reword, reorder commits. Clean history like a pro.</p>
</p></div>
<h3 style="color: #2c3e50; font-size: 2.2em; margin: 50px 0 30px 0; font-weight: 700; border-left: 5px solid #f5576c; padding-left: 20px;">The Messy History Problem</h3>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">
git log --oneline

a1b2c3d fix typo
d4e5f6g WIP
g7h8i9j oops forgot file
j1k2l3m fix typo again
m4n5o6p actually fix the bug
p7q8r9s Add feature X

# 6 commits for 1 feature!
# Confusing for code review
# Clutters git history
</pre>
<h3 style="color: #2c3e50; font-size: 2.2em; margin: 50px 0 30px 0; font-weight: 700; border-left: 5px solid #27ae60; padding-left: 20px;">Interactive Rebase to Rescue</h3>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">
# Rebase last 6 commits
git rebase -i HEAD~6

# Or rebase from specific commit
git rebase -i a1b2c3d

# Editor opens with commit list:
pick a1b2c3d fix typo
pick d4e5f6g WIP
pick g7h8i9j oops forgot file
pick j1k2l3m fix typo again
pick m4n5o6p actually fix the bug
pick p7q8r9s Add feature X

# Commands available:
# pick   = use commit
# reword = use commit, but edit message
# edit   = use commit, but stop for amending
# squash = use commit, combine with previous
# fixup  = like squash, discard commit message
# drop   = remove commit
</pre>
<div style="background: #f8f9fa; padding: 40px; border-radius: 12px; margin: 40px 0; border: 2px solid #f093fb;">
<h4 style="color: #f5576c; margin-top: 0; font-size: 1.7em; font-weight: 700;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f3af.png" alt="🎯" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Common Rebase Actions</h4>
<h5 style="color: #667eea; font-size: 1.4em; margin: 25px 0 15px 0;">1. Squash Commits</h5>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">
# Combine multiple commits into one
pick p7q8r9s Add feature X
squash m4n5o6p actually fix the bug
squash j1k2l3m fix typo again
squash g7h8i9j oops forgot file
squash d4e5f6g WIP
squash a1b2c3d fix typo

# Save and close
# New editor opens for combined commit message
# Result: 6 commits → 1 clean commit
</pre>
<h5 style="color: #667eea; font-size: 1.4em; margin: 25px 0 15px 0;">2. Fixup (Squash Without Message)</h5>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">
pick p7q8r9s Add feature X
fixup m4n5o6p actually fix the bug
fixup j1k2l3m fix typo again
fixup g7h8i9j oops forgot file
fixup d4e5f6g WIP
fixup a1b2c3d fix typo

# Like squash, but automatically uses first commit's message
# No need to edit combined message
</pre>
<h5 style="color: #667eea; font-size: 1.4em; margin: 25px 0 15px 0;">3. Reword Commit Messages</h5>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">
reword a1b2c3d fix typo
pick d4e5f6g Add authentication

# Editor opens for each 'reword'
# Change message, save, continue
</pre>
<h5 style="color: #667eea; font-size: 1.4em; margin: 25px 0 15px 0;">4. Reorder Commits</h5>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">
# Just reorder lines
pick d4e5f6g Add tests
pick a1b2c3d Add feature
pick g7h8i9j Update docs

# Changes order in history
</pre>
<h5 style="color: #667eea; font-size: 1.4em; margin: 25px 0 15px 0;">5. Drop Commits</h5>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">
pick a1b2c3d Add feature
drop d4e5f6g debug logging
pick g7h8i9j Update docs

# Or just delete the line (same effect)
pick a1b2c3d Add feature
pick g7h8i9j Update docs
</pre>
</p></div>
<h3 style="color: #2c3e50; font-size: 2.2em; margin: 50px 0 30px 0; font-weight: 700; border-left: 5px solid #667eea; padding-left: 20px;">Real-World Workflow</h3>
<div style="background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); color: white; padding: 35px; border-radius: 12px; margin: 40px 0;">
<h4 style="margin-top: 0; font-size: 1.7em; font-weight: 700;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4cb.png" alt="📋" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Before PR Cleanup</h4>
<pre style="background: rgba(0,0,0,0.3); color: #fff; padding: 25px; border-radius: 8px; font-size: 1.05em; line-height: 1.8;">
# You've been working on feature branch
git log --oneline
a1b2c3d fix lint error
d4e5f6g remove console.log
g7h8i9j WIP save work
j1k2l3m add login component
m4n5o6p fix button style
p7q8r9s add logout
q1r2s3t initial auth setup

# Clean up before PR
git rebase -i HEAD~7

# In editor:
pick q1r2s3t initial auth setup
fixup j1k2l3m add login component
fixup p7q8r9s add logout
fixup m4n5o6p fix button style
fixup g7h8i9j WIP save work
fixup d4e5f6g remove console.log
fixup a1b2c3d fix lint error

# Save, close
# Result: 1 clean commit "Add authentication system"

git log --oneline
t4u5v6w Add authentication system

# Beautiful history for PR!
</pre>
</p></div>
<h3 style="color: #2c3e50; font-size: 2.2em; margin: 50px 0 30px 0; font-weight: 700; border-left: 5px solid #f39c12; padding-left: 20px;">Handle Conflicts</h3>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">
# If conflicts during rebase
git rebase -i HEAD~5

# Git stops:
# CONFLICT (content): Merge conflict in file.js

# Fix conflicts in file
vim file.js  # Resolve conflicts

# Mark as resolved
git add file.js

# Continue rebase
git rebase --continue

# Or abort if things go wrong
git rebase --abort
</pre>
<div style="background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%); padding: 35px; border-radius: 12px; margin: 40px 0; border-left: 5px solid #28a745;">
<h4 style="color: #155724; margin-top: 0; font-size: 1.7em; font-weight: 700;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> When to Use Interactive Rebase</h4>
<ul style="color: #155724; font-size: 1.15em; line-height: 2.2; margin: 20px 0;">
<li><strong>Before PR/MR:</strong> Clean up feature branch history</li>
<li><strong>WIP commits:</strong> Squash &#8216;work in progress&#8217; commits</li>
<li><strong>Fix commit messages:</strong> Typos, unclear messages</li>
<li><strong>Reorder logical flow:</strong> Tests before implementation</li>
<li><strong>Remove sensitive data:</strong> Accidentally committed secrets</li>
</ul></div>
<div style="background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%); border-left: 5px solid #ffc107; padding: 35px; margin: 50px 0; border-radius: 12px;">
<h4 style="color: #856404; margin-top: 0; font-size: 1.7em; font-weight: 700;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/26a0.png" alt="⚠" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Important Rules</h4>
<ul style="color: #856404; font-size: 1.15em; line-height: 2.2; margin: 20px 0;">
<li><strong>Never rebase public branches:</strong> Only rebase local/feature branches</li>
<li><strong>Don&#8217;t rebase after push:</strong> Rewrites history, breaks others&#8217; work</li>
<li><strong>Force push required:</strong> git push &#8211;force-with-lease after rebase</li>
<li><strong>Communicate with team:</strong> If others are working on same branch</li>
<li><strong>Keep backups:</strong> git branch backup-branch before rebase</li>
</ul></div>
<div style="background: #f8f9fa; padding: 40px; border-radius: 12px; margin: 40px 0; border: 2px solid #f093fb;">
<h4 style="color: #f5576c; margin-top: 0; font-size: 1.7em; font-weight: 700;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4a1.png" alt="💡" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Pro Tips</h4>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">
# Auto-squash: Prepare commits for easy squashing
git commit --fixup a1b2c3d  # Creates fixup! commit
git rebase -i --autosquash HEAD~10  # Auto-arranges fixups

# Set autosquash as default
git config --global rebase.autosquash true

# Use different editor
git config --global core.editor "code --wait"

# Rebase onto different branch
git rebase -i main  # Rebase current branch onto main

# Split a commit
# 1. Mark commit as 'edit'
# 2. Git stops at that commit
# 3. git reset HEAD^
# 4. git add -p (stage hunks separately)
# 5. git commit (multiple times)
# 6. git rebase --continue
</pre>
</p></div>
<div style="background: #f8f9fa; padding: 40px; border-radius: 12px; margin: 40px 0; border: 2px solid #f093fb;">
<h4 style="color: #f5576c; margin-top: 0; font-size: 1.7em; font-weight: 700;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f3af.png" alt="🎯" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Cheat Sheet</h4>
<table style="width: 100%; border-collapse: collapse; margin: 20px 0;">
<tr style="background: #f093fb; color: white;">
<th style="padding: 15px; text-align: left;">Command</th>
<th style="padding: 15px; text-align: left;">Action</th>
</tr>
<tr>
<td style="padding: 12px; border-bottom: 1px solid #ddd;"><code>git rebase -i HEAD~N</code></td>
<td style="padding: 12px; border-bottom: 1px solid #ddd;">Rebase last N commits</td>
</tr>
<tr style="background: #f8f9fa;">
<td style="padding: 12px; border-bottom: 1px solid #ddd;"><code>pick</code></td>
<td style="padding: 12px; border-bottom: 1px solid #ddd;">Keep commit as-is</td>
</tr>
<tr>
<td style="padding: 12px; border-bottom: 1px solid #ddd;"><code>squash</code></td>
<td style="padding: 12px; border-bottom: 1px solid #ddd;">Combine with previous</td>
</tr>
<tr style="background: #f8f9fa;">
<td style="padding: 12px; border-bottom: 1px solid #ddd;"><code>fixup</code></td>
<td style="padding: 12px; border-bottom: 1px solid #ddd;">Squash, discard message</td>
</tr>
<tr>
<td style="padding: 12px; border-bottom: 1px solid #ddd;"><code>reword</code></td>
<td style="padding: 12px; border-bottom: 1px solid #ddd;">Edit commit message</td>
</tr>
<tr style="background: #f8f9fa;">
<td style="padding: 12px; border-bottom: 1px solid #ddd;"><code>drop</code></td>
<td style="padding: 12px; border-bottom: 1px solid #ddd;">Remove commit</td>
</tr>
<tr>
<td style="padding: 12px;"><code>git rebase --abort</code></td>
<td style="padding: 12px;">Cancel rebase</td>
</tr>
</table></div>
<blockquote style="background: linear-gradient(to right, #fce4ec, #f8bbd0); border-left: 6px solid #e91e63; padding: 40px; margin: 50px 0; border-radius: 12px;">
<p style="font-size: 1.5em; line-height: 1.9; margin: 0; color: #880e4f; font-style: italic; font-weight: 500;">&#8220;Used to submit PRs with 30+ WIP commits. Reviewers complained. Learned interactive rebase. Now: 3-5 clean, logical commits per PR. Reviews take half the time. Team loves me.&#8221;</p>
<footer style="margin-top: 20px; color: #ad1457; font-size: 1.15em; font-weight: 600;">— Senior Developer</footer>
</blockquote>
]]></content:encoded>
					
					<wfw:commentRss>http://blog.ercanopak.com/git-use-interactive-rebase-to-clean-up-commit-history-before-merge/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Git: Use git cherry-pick to Copy Specific Commits Between Branches</title>
		<link>http://blog.ercanopak.com/git-use-git-cherry-pick-to-copy-specific-commits-between-branches-2/</link>
					<comments>http://blog.ercanopak.com/git-use-git-cherry-pick-to-copy-specific-commits-between-branches-2/#respond</comments>
		
		<dc:creator><![CDATA[ErcanOPAK]]></dc:creator>
		<pubDate>Sun, 22 Mar 2026 09:04:53 +0000</pubDate>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[Branch Management]]></category>
		<category><![CDATA[Cherry Pick]]></category>
		<category><![CDATA[Code Deployment]]></category>
		<category><![CDATA[git cherry-pick]]></category>
		<category><![CDATA[Git Commands]]></category>
		<category><![CDATA[Git Tips]]></category>
		<category><![CDATA[Git Workflow]]></category>
		<category><![CDATA[Hotfix]]></category>
		<category><![CDATA[Version Control]]></category>
		<guid isPermaLink="false">http://blog.ercanopak.com/git-use-git-cherry-pick-to-copy-specific-commits-between-branches-2/</guid>

					<description><![CDATA[🍒 Pick Commits Like Cherries Need one commit from feature branch in production? Don&#8217;t merge entire branch. Cherry-pick that commit. The Scenario # Feature branch has 10 commits feature-branch: abc123 - Add user login def456 - Fix critical security bug ← Need this in production NOW ghi789 - Add dashboard ... 7 more commits # [&#8230;]]]></description>
										<content:encoded><![CDATA[<div style="background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); color: white; padding: 50px 40px; border-radius: 16px; margin: 40px 0; box-shadow: 0 20px 60px rgba(0,0,0,0.3);">
<h2 style="margin: 0 0 20px 0; font-size: 2.8em; font-weight: 800; line-height: 1.2;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f352.png" alt="🍒" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Pick Commits Like Cherries</h2>
<p style="font-size: 1.4em; line-height: 1.8; margin: 0; opacity: 0.95;">Need one commit from feature branch in production? Don&#8217;t merge entire branch. <strong>Cherry-pick</strong> that commit.</p>
</p></div>
<h3 style="color: #2c3e50; font-size: 2.2em; margin: 50px 0 30px 0; font-weight: 700; border-left: 5px solid #00f2fe; padding-left: 20px;">The Scenario</h3>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">
# Feature branch has 10 commits
feature-branch:
  abc123 - Add user login
  def456 - Fix critical security bug  ← Need this in production NOW
  ghi789 - Add dashboard
  ... 7 more commits

# Can't merge entire branch (not ready)
# Just need that one security fix

# Solution: Cherry-pick!
</pre>
<h3 style="color: #2c3e50; font-size: 2.2em; margin: 50px 0 30px 0; font-weight: 700; border-left: 5px solid #27ae60; padding-left: 20px;">Basic Cherry-Pick</h3>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">
# Find commit hash
git log feature-branch
# def456 - Fix critical security bug

# Switch to target branch
git checkout main

# Cherry-pick that commit
git cherry-pick def456

# Commit is now in main!
git log
# def456 - Fix critical security bug (same changes, new hash)

# Push to production
git push origin main
</pre>
<div style="background: #f8f9fa; padding: 40px; border-radius: 12px; margin: 40px 0; border: 2px solid #4facfe;">
<h4 style="color: #00f2fe; margin-top: 0; font-size: 1.7em; font-weight: 700;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f3af.png" alt="🎯" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Cherry-Pick Options</h4>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">
# Cherry-pick without committing (stage changes only)
git cherry-pick --no-commit abc123

# Cherry-pick multiple commits
git cherry-pick abc123 def456 ghi789

# Cherry-pick range of commits
git cherry-pick abc123..ghi789

# Cherry-pick with custom commit message
git cherry-pick abc123 --edit

# Cherry-pick and sign off
git cherry-pick abc123 -s
</pre>
</p></div>
<h3 style="color: #2c3e50; font-size: 2.2em; margin: 50px 0 30px 0; font-weight: 700; border-left: 5px solid #f39c12; padding-left: 20px;">Handling Conflicts</h3>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">
# Cherry-pick causes conflict
git cherry-pick abc123
# CONFLICT (content): Merge conflict in app.js

# Fix conflicts manually
vim app.js

# Mark as resolved
git add app.js

# Continue cherry-pick
git cherry-pick --continue

# Or abort if you change your mind
git cherry-pick --abort
</pre>
<div style="background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); color: white; padding: 35px; border-radius: 12px; margin: 40px 0;">
<h4 style="margin-top: 0; font-size: 1.7em; font-weight: 700;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f527.png" alt="🔧" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Real-World Example</h4>
<pre style="background: rgba(0,0,0,0.3); color: #fff; padding: 25px; border-radius: 8px; font-size: 1.05em; line-height: 1.8;">
# Hotfix needed from development branch
$ git checkout main
$ git pull

# Find the bug fix commit
$ git log develop --oneline
# a1b2c3d Fix payment processing timeout
# d4e5f6g Add new feature X
# g7h8i9j Refactor user service

# Cherry-pick just the fix
$ git cherry-pick a1b2c3d

# Deploy to production
$ git push origin main

# The fix is live!
# Feature X stays in develop until ready
</pre>
</p></div>
<h3 style="color: #2c3e50; font-size: 2.2em; margin: 50px 0 30px 0; font-weight: 700; border-left: 5px solid #667eea; padding-left: 20px;">When to Use Cherry-Pick</h3>
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 25px; margin: 40px 0;">
<div style="background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%); color: white; padding: 30px; border-radius: 12px;">
<h4 style="margin-top: 0; font-size: 1.6em;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Good Uses</h4>
<ul style="line-height: 2; font-size: 1.05em; margin: 15px 0;">
<li>Hotfixes to production</li>
<li>Bug fix from feature branch</li>
<li>Undo/redo specific change</li>
<li>Copy commit to release branch</li>
</ul></div>
<div style="background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%); color: white; padding: 30px; border-radius: 12px;">
<h4 style="margin-top: 0; font-size: 1.6em;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/274c.png" alt="❌" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Bad Uses</h4>
<ul style="line-height: 2; font-size: 1.05em; margin: 15px 0;">
<li>Instead of proper merge</li>
<li>Copying many commits</li>
<li>Regular workflow</li>
<li>Complete feature transfer</li>
</ul></div>
</p></div>
<div style="background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%); padding: 35px; border-radius: 12px; margin: 40px 0; border-left: 5px solid #28a745;">
<h4 style="color: #155724; margin-top: 0; font-size: 1.7em; font-weight: 700;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4a1.png" alt="💡" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Pro Tips</h4>
<ul style="color: #155724; font-size: 1.15em; line-height: 2.2; margin: 20px 0;">
<li><strong>Use -x flag:</strong> <code>git cherry-pick -x abc123</code> adds reference to original commit</li>
<li><strong>Check what will be picked:</strong> <code>git show abc123</code> before cherry-picking</li>
<li><strong>Keep commits small:</strong> Easier to cherry-pick atomic commits</li>
<li><strong>Document why:</strong> Add note in commit message about cherry-pick</li>
</ul></div>
<div style="background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%); border-left: 5px solid #ffc107; padding: 35px; margin: 50px 0; border-radius: 12px;">
<h4 style="color: #856404; margin-top: 0; font-size: 1.7em; font-weight: 700;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/26a0.png" alt="⚠" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Cautions</h4>
<ul style="color: #856404; font-size: 1.15em; line-height: 2.2; margin: 20px 0;">
<li><strong>Creates duplicate commits:</strong> Same changes, different hash</li>
<li><strong>Can cause conflicts:</strong> When merging branches later</li>
<li><strong>Loses context:</strong> Commit may depend on others</li>
<li><strong>Don&#8217;t overuse:</strong> Prefer proper merges for normal workflow</li>
</ul></div>
<blockquote style="background: linear-gradient(to right, #e0f7fa, #b2ebf2); border-left: 6px solid #00bcd4; padding: 40px; margin: 50px 0; border-radius: 12px;">
<p style="font-size: 1.5em; line-height: 1.9; margin: 0; color: #006064; font-style: italic; font-weight: 500;">&#8220;Production down. Fix was in develop branch with 20 other commits. Cherry-picked the fix, deployed in 5 minutes. Site back up. Cherry-pick saved the day.&#8221;</p>
<footer style="margin-top: 20px; color: #00838f; font-size: 1.15em; font-weight: 600;">— DevOps Engineer</footer>
</blockquote>
]]></content:encoded>
					
					<wfw:commentRss>http://blog.ercanopak.com/git-use-git-cherry-pick-to-copy-specific-commits-between-branches-2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Git: Use git stash to Save Work Without Committing</title>
		<link>http://blog.ercanopak.com/git-use-git-stash-to-save-work-without-committing/</link>
					<comments>http://blog.ercanopak.com/git-use-git-stash-to-save-work-without-committing/#respond</comments>
		
		<dc:creator><![CDATA[ErcanOPAK]]></dc:creator>
		<pubDate>Sun, 22 Mar 2026 09:04:47 +0000</pubDate>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[Context Switching]]></category>
		<category><![CDATA[Developer Productivity]]></category>
		<category><![CDATA[git best practices]]></category>
		<category><![CDATA[Git Commands]]></category>
		<category><![CDATA[Git Stash]]></category>
		<category><![CDATA[Git Tips]]></category>
		<category><![CDATA[Version Control]]></category>
		<category><![CDATA[WIP]]></category>
		<guid isPermaLink="false">http://blog.ercanopak.com/git-use-git-stash-to-save-work-without-committing/</guid>

					<description><![CDATA[💾 Save Work, Switch Branch, Come Back Halfway through feature. Emergency bug fix needed. Don&#8217;t want to commit messy code. git stash saves work temporarily. The Problem # Working on feature branch git status # modified: feature.js # modified: styles.css # Boss: "Fix production bug NOW!" git checkout main # Error: Your local changes would [&#8230;]]]></description>
										<content:encoded><![CDATA[<div style="background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); color: white; padding: 50px 40px; border-radius: 16px; margin: 40px 0; box-shadow: 0 20px 60px rgba(0,0,0,0.3);">
<h2 style="margin: 0 0 20px 0; font-size: 2.8em; font-weight: 800; line-height: 1.2;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4be.png" alt="💾" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Save Work, Switch Branch, Come Back</h2>
<p style="font-size: 1.4em; line-height: 1.8; margin: 0; opacity: 0.95;">Halfway through feature. Emergency bug fix needed. Don&#8217;t want to commit messy code. <strong>git stash</strong> saves work temporarily.</p>
</p></div>
<h3 style="color: #2c3e50; font-size: 2.2em; margin: 50px 0 30px 0; font-weight: 700; border-left: 5px solid #f5576c; padding-left: 20px;">The Problem</h3>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">
# Working on feature branch
git status
# modified:   feature.js
# modified:   styles.css

# Boss: "Fix production bug NOW!"
git checkout main
# Error: Your local changes would be overwritten
# Please commit or stash them

# Options:
# 1. Commit messy half-done work <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/274c.png" alt="❌" class="wp-smiley" style="height: 1em; max-height: 1em;" />
# 2. Create throwaway commit <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/274c.png" alt="❌" class="wp-smiley" style="height: 1em; max-height: 1em;" />
# 3. Copy files somewhere else <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/274c.png" alt="❌" class="wp-smiley" style="height: 1em; max-height: 1em;" />
# 4. Use git stash <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" />
</pre>
<h3 style="color: #2c3e50; font-size: 2.2em; margin: 50px 0 30px 0; font-weight: 700; border-left: 5px solid #27ae60; padding-left: 20px;">Basic Stash Usage</h3>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">
# Save current changes
git stash
# Saved working directory and index state

# Working directory now clean
git status
# nothing to commit, working tree clean

# Switch to other branch
git checkout main

# Fix bug, commit, push

# Go back to feature branch
git checkout feature-branch

# Restore stashed changes
git stash pop
# Changes restored, stash removed

# Continue working!
</pre>
<div style="background: #f8f9fa; padding: 40px; border-radius: 12px; margin: 40px 0; border: 2px solid #f093fb;">
<h4 style="color: #f5576c; margin-top: 0; font-size: 1.7em; font-weight: 700;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f3af.png" alt="🎯" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Essential Stash Commands</h4>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">
# Save with descriptive message
git stash save "WIP: user authentication form"

# List all stashes
git stash list
# stash@{0}: WIP: user authentication form
# stash@{1}: WIP: homepage redesign
# stash@{2}: On main: quick fix

# Apply stash without removing it
git stash apply stash@{0}

# Apply and remove (like pop)
git stash pop stash@{0}

# Show what's in a stash
git stash show stash@{0}

# Show full diff
git stash show -p stash@{0}

# Delete specific stash
git stash drop stash@{0}

# Delete all stashes
git stash clear
</pre>
</p></div>
<h3 style="color: #2c3e50; font-size: 2.2em; margin: 50px 0 30px 0; font-weight: 700; border-left: 5px solid #667eea; padding-left: 20px;">Advanced Stash Tricks</h3>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">
# Stash only staged changes
git stash --staged

# Stash including untracked files
git stash -u

# Stash everything (including ignored files)
git stash -a

# Stash specific files only
git stash push -m "message" path/to/file.js

# Create branch from stash
git stash branch new-feature-branch stash@{0}
# Creates branch, applies stash, drops stash
# Perfect when stash has conflicts with current branch

# Stash interactively (choose what to stash)
git stash -p
# Goes through each change, asks: stash this hunk?
</pre>
<div style="background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); color: white; padding: 35px; border-radius: 12px; margin: 40px 0;">
<h4 style="margin-top: 0; font-size: 1.7em; font-weight: 700;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f504.png" alt="🔄" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Real Workflow</h4>
<pre style="background: rgba(0,0,0,0.3); color: #fff; padding: 25px; border-radius: 8px; font-size: 1.05em; line-height: 1.8;">
# Working on feature
$ vim feature.js

# Emergency: fix production bug
$ git stash save "WIP: user login form validation"
$ git checkout main
$ git pull

# Create hotfix branch
$ git checkout -b hotfix-payment-bug
$ vim payment.js
$ git add payment.js
$ git commit -m "Fix: payment timeout issue"
$ git push origin hotfix-payment-bug

# Back to feature
$ git checkout feature-branch
$ git stash pop

# Continue where you left off!
</pre>
</p></div>
<h3 style="color: #2c3e50; font-size: 2.2em; margin: 50px 0 30px 0; font-weight: 700; border-left: 5px solid #f39c12; padding-left: 20px;">Stash vs Commit</h3>
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 25px; margin: 40px 0;">
<div style="background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%); color: white; padding: 30px; border-radius: 12px;">
<h4 style="margin-top: 0; font-size: 1.6em;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> When to Stash</h4>
<ul style="line-height: 2; font-size: 1.05em; margin: 15px 0;">
<li>Temporary context switch</li>
<li>Work in progress, not ready</li>
<li>Experimenting, might discard</li>
<li>Quick bug fix interruption</li>
</ul></div>
<div style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 30px; border-radius: 12px;">
<h4 style="margin-top: 0; font-size: 1.6em;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> When to Commit</h4>
<ul style="line-height: 2; font-size: 1.05em; margin: 15px 0;">
<li>Logical unit of work done</li>
<li>Want to keep in history</li>
<li>Ready for code review</li>
<li>Stable checkpoint</li>
</ul></div>
</p></div>
<div style="background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%); padding: 35px; border-radius: 12px; margin: 40px 0; border-left: 5px solid #28a745;">
<h4 style="color: #155724; margin-top: 0; font-size: 1.7em; font-weight: 700;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4a1.png" alt="💡" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Pro Tips</h4>
<ul style="color: #155724; font-size: 1.15em; line-height: 2.2; margin: 20px 0;">
<li><strong>Use descriptive messages:</strong> Future you will thank you</li>
<li><strong>Don&#8217;t hoard stashes:</strong> Clean up old ones regularly</li>
<li><strong>Stash before pull:</strong> Avoid merge conflicts with uncommitted work</li>
<li><strong>Create alias:</strong> <code>git config --global alias.save 'stash save'</code></li>
</ul></div>
<div style="background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%); border-left: 5px solid #ffc107; padding: 35px; margin: 50px 0; border-radius: 12px;">
<h4 style="color: #856404; margin-top: 0; font-size: 1.7em; font-weight: 700;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/26a0.png" alt="⚠" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Common Mistakes</h4>
<ul style="color: #856404; font-size: 1.15em; line-height: 2.2; margin: 20px 0;">
<li><strong>Forgetting about stashes:</strong> Check <code>git stash list</code> regularly</li>
<li><strong>Stashing too much:</strong> Multiple stashes get confusing</li>
<li><strong>Not using messages:</strong> <code>stash@{3}</code> tells you nothing</li>
<li><strong>Conflicts on pop:</strong> Resolve like merge conflicts, then drop stash manually</li>
</ul></div>
<blockquote style="background: linear-gradient(to right, #fce4ec, #f8bbd0); border-left: 6px solid #e91e63; padding: 40px; margin: 50px 0; border-radius: 12px;">
<p style="font-size: 1.5em; line-height: 1.9; margin: 0; color: #880e4f; font-style: italic; font-weight: 500;">&#8220;Before git stash, interruptions meant messy commits or lost work. Now I stash, fix bugs, come back instantly. Saved me dozens of times during on-call weeks.&#8221;</p>
<footer style="margin-top: 20px; color: #ad1457; font-size: 1.15em; font-weight: 600;">— Senior Developer</footer>
</blockquote>
]]></content:encoded>
					
					<wfw:commentRss>http://blog.ercanopak.com/git-use-git-stash-to-save-work-without-committing/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Git: Use git blame -L to Find Who Wrote Specific Lines</title>
		<link>http://blog.ercanopak.com/git-use-git-blame-l-to-find-who-wrote-specific-lines/</link>
					<comments>http://blog.ercanopak.com/git-use-git-blame-l-to-find-who-wrote-specific-lines/#respond</comments>
		
		<dc:creator><![CDATA[ErcanOPAK]]></dc:creator>
		<pubDate>Thu, 19 Mar 2026 20:28:55 +0000</pubDate>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[Author Tracking]]></category>
		<category><![CDATA[Code History]]></category>
		<category><![CDATA[Code Investigation]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[git blame]]></category>
		<category><![CDATA[Git Commands]]></category>
		<category><![CDATA[Git Tips]]></category>
		<category><![CDATA[GitLens]]></category>
		<category><![CDATA[Version Control]]></category>
		<guid isPermaLink="false">http://blog.ercanopak.com/git-use-git-blame-l-to-find-who-wrote-specific-lines/</guid>

					<description><![CDATA[🔍 Who Wrote This Code? Bug in production. Need to know who wrote line 247. git blame tells you author, date, commit. Basic Usage # Entire file git blame filename.js # Specific line range git blame -L 100,150 filename.js # Show line 247 only git blame -L 247,247 filename.js # Output: # abc12345 (John Doe [&#8230;]]]></description>
										<content:encoded><![CDATA[<div style="background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); color: white; padding: 50px 40px; border-radius: 16px; margin: 40px 0; box-shadow: 0 20px 60px rgba(0,0,0,0.3);">
<h2 style="margin: 0 0 20px 0; font-size: 2.8em; font-weight: 800; line-height: 1.2;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f50d.png" alt="🔍" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Who Wrote This Code?</h2>
<p style="font-size: 1.4em; line-height: 1.8; margin: 0; opacity: 0.95;">Bug in production. Need to know who wrote line 247. <strong>git blame</strong> tells you author, date, commit.</p>
</p></div>
<h3 style="color: #2c3e50; font-size: 2.2em; margin: 50px 0 30px 0; font-weight: 700; border-left: 5px solid #f5576c; padding-left: 20px;">Basic Usage</h3>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">
# Entire file
git blame filename.js

# Specific line range
git blame -L 100,150 filename.js

# Show line 247 only
git blame -L 247,247 filename.js

# Output:
# abc12345 (John Doe 2024-01-15 14:23:45) const buggyFunction = () => {
</pre>
<div style="background: #f8f9fa; padding: 40px; border-radius: 12px; margin: 40px 0; border: 2px solid #f093fb;">
<h4 style="color: #f5576c; margin-top: 0; font-size: 1.7em; font-weight: 700;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f3af.png" alt="🎯" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Useful Flags</h4>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">
# Show email instead of name
git blame -e filename.js

# Ignore whitespace changes
git blame -w filename.js

# Show commit message
git blame -s filename.js | git show abc12345

# Find who moved/copied this code
git blame -C filename.js

# Follow through file renames
git blame -M filename.js
</pre>
</p></div>
<h3 style="color: #2c3e50; font-size: 2.2em; margin: 50px 0 30px 0; font-weight: 700; border-left: 5px solid #667eea; padding-left: 20px;">VS Code Integration</h3>
<div style="background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%); padding: 35px; border-radius: 12px; margin: 40px 0; border-left: 5px solid #2196f3;">
<p style="color: #1565c0; font-size: 1.15em; line-height: 1.9; margin: 0 0 20px 0;"><strong>GitLens Extension:</strong> Shows git blame inline as you code</p>
<ul style="color: #0d47a1; font-size: 1.1em; line-height: 2.2; margin: 0;">
<li>Hover over any line → See author, date, commit message</li>
<li>Click commit hash → View full diff</li>
<li>No terminal needed</li>
</ul></div>
<h3 style="color: #2c3e50; font-size: 2.2em; margin: 50px 0 30px 0; font-weight: 700; border-left: 5px solid #f39c12; padding-left: 20px;">Real Debugging Workflow</h3>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">
# 1. Find buggy line
git blame -L 247,247 app.js
# Output: abc12345 (Sarah 2024-01-10) if (user = admin) {

# 2. View full commit
git show abc12345

# 3. See what changed
git diff abc12345^ abc12345

# 4. Contact Sarah or check commit message for context
</pre>
<div style="background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%); border-left: 5px solid #ffc107; padding: 35px; margin: 50px 0; border-radius: 12px;">
<h4 style="color: #856404; margin-top: 0; font-size: 1.7em; font-weight: 700;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4a1.png" alt="💡" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Pro Tip: Ignore Formatting Commits</h4>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">
# Create .git-blame-ignore-revs
echo "abc1234" >> .git-blame-ignore-revs

# Configure git to use it
git config blame.ignoreRevsFile .git-blame-ignore-revs

# Now blame ignores that formatting commit
</pre>
</p></div>
<blockquote style="background: linear-gradient(to right, #fce4ec, #f8bbd0); border-left: 6px solid #e91e63; padding: 40px; margin: 50px 0; border-radius: 12px;">
<p style="font-size: 1.5em; line-height: 1.9; margin: 0; color: #880e4f; font-style: italic; font-weight: 500;">&#8220;Production bug traced to line 512. Git blame showed it was added 6 months ago in PR #347. Found original context, fixed properly instead of band-aid fix.&#8221;</p>
<footer style="margin-top: 20px; color: #ad1457; font-size: 1.15em; font-weight: 600;">— Senior Developer</footer>
</blockquote>
]]></content:encoded>
					
					<wfw:commentRss>http://blog.ercanopak.com/git-use-git-blame-l-to-find-who-wrote-specific-lines/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Git: Use Interactive Rebase to Clean Up Commit History</title>
		<link>http://blog.ercanopak.com/git-use-interactive-rebase-to-clean-up-commit-history/</link>
					<comments>http://blog.ercanopak.com/git-use-interactive-rebase-to-clean-up-commit-history/#respond</comments>
		
		<dc:creator><![CDATA[ErcanOPAK]]></dc:creator>
		<pubDate>Thu, 19 Mar 2026 20:28:47 +0000</pubDate>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[Clean Commits]]></category>
		<category><![CDATA[Code Review]]></category>
		<category><![CDATA[Commit History]]></category>
		<category><![CDATA[Git Commands]]></category>
		<category><![CDATA[Git Rebase]]></category>
		<category><![CDATA[Git Tips]]></category>
		<category><![CDATA[Git Workflow]]></category>
		<category><![CDATA[Interactive Rebase]]></category>
		<category><![CDATA[Version Control]]></category>
		<guid isPermaLink="false">http://blog.ercanopak.com/git-use-interactive-rebase-to-clean-up-commit-history/</guid>

					<description><![CDATA[✨ Rewrite Git History Like a Pro 10 messy commits saying &#8216;fix&#8217;, &#8216;oops&#8217;, &#8216;wtf&#8217;. Interactive rebase turns them into one clean, professional commit. Start Interactive Rebase # Rebase last 5 commits git rebase -i HEAD~5 # Or from specific commit git rebase -i abc1234 # Editor opens with commit list: pick abc1234 Add login feature [&#8230;]]]></description>
										<content:encoded><![CDATA[<div style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 50px 40px; border-radius: 16px; margin: 40px 0; box-shadow: 0 20px 60px rgba(0,0,0,0.3);">
<h2 style="margin: 0 0 20px 0; font-size: 2.8em; font-weight: 800; line-height: 1.2;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2728.png" alt="✨" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Rewrite Git History Like a Pro</h2>
<p style="font-size: 1.4em; line-height: 1.8; margin: 0; opacity: 0.95;">10 messy commits saying &#8216;fix&#8217;, &#8216;oops&#8217;, &#8216;wtf&#8217;. Interactive rebase turns them into one clean, professional commit.</p>
</p></div>
<h3 style="color: #2c3e50; font-size: 2.2em; margin: 50px 0 30px 0; font-weight: 700; border-left: 5px solid #764ba2; padding-left: 20px;">Start Interactive Rebase</h3>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">
# Rebase last 5 commits
git rebase -i HEAD~5

# Or from specific commit
git rebase -i abc1234

# Editor opens with commit list:
pick abc1234 Add login feature
pick def5678 fix typo
pick ghi9012 actually fix it
pick jkl3456 forgot to add file
pick mno7890 Update login feature
</pre>
<div style="background: #f8f9fa; padding: 40px; border-radius: 12px; margin: 40px 0; border: 2px solid #667eea;">
<h4 style="color: #667eea; margin-top: 0; font-size: 1.7em; font-weight: 700;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f3af.png" alt="🎯" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Interactive Commands</h4>
<table style="width: 100%; border-collapse: collapse; margin: 20px 0;">
<tr style="background: #667eea; color: white;">
<th style="padding: 15px; text-align: left;">Command</th>
<th style="padding: 15px; text-align: left;">What It Does</th>
</tr>
<tr>
<td style="padding: 12px; border-bottom: 1px solid #ddd; font-weight: bold;">pick</td>
<td style="padding: 12px; border-bottom: 1px solid #ddd;">Keep commit as-is</td>
</tr>
<tr style="background: #f8f9fa;">
<td style="padding: 12px; border-bottom: 1px solid #ddd; font-weight: bold;">reword</td>
<td style="padding: 12px; border-bottom: 1px solid #ddd;">Change commit message</td>
</tr>
<tr>
<td style="padding: 12px; border-bottom: 1px solid #ddd; font-weight: bold;">squash</td>
<td style="padding: 12px; border-bottom: 1px solid #ddd;">Merge into previous commit</td>
</tr>
<tr style="background: #f8f9fa;">
<td style="padding: 12px; border-bottom: 1px solid #ddd; font-weight: bold;">fixup</td>
<td style="padding: 12px; border-bottom: 1px solid #ddd;">Squash but discard message</td>
</tr>
<tr>
<td style="padding: 12px; border-bottom: 1px solid #ddd; font-weight: bold;">drop</td>
<td style="padding: 12px; border-bottom: 1px solid #ddd;">Delete commit entirely</td>
</tr>
<tr style="background: #f8f9fa;">
<td style="padding: 12px;">edit</td>
<td style="padding: 12px;">Stop to amend commit</td>
</tr>
</table></div>
<h3 style="color: #2c3e50; font-size: 2.2em; margin: 50px 0 30px 0; font-weight: 700; border-left: 5px solid #27ae60; padding-left: 20px;">Clean Up Example</h3>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">
# Before (messy):
pick abc1234 Add login feature
pick def5678 fix typo
pick ghi9012 actually fix it
pick jkl3456 forgot to add file
pick mno7890 Update login feature

# Change to (clean):
pick abc1234 Add login feature
fixup def5678 fix typo
fixup ghi9012 actually fix it
fixup jkl3456 forgot to add file
squash mno7890 Update login feature

# Result: 2 clean commits instead of 5 messy ones
</pre>
<div style="background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%); border-left: 5px solid #ffc107; padding: 35px; margin: 50px 0; border-radius: 12px;">
<h4 style="color: #856404; margin-top: 0; font-size: 1.7em; font-weight: 700;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/26a0.png" alt="⚠" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Golden Rules</h4>
<ul style="color: #856404; font-size: 1.15em; line-height: 2.2; margin: 20px 0;">
<li><strong>NEVER rebase public commits:</strong> Only rebase commits that haven&#8217;t been pushed</li>
<li><strong>OR:</strong> Only if you&#8217;re alone on the branch</li>
<li><strong>Backup first:</strong> <code>git branch backup-branch</code> before rebasing</li>
<li><strong>Conflict resolution:</strong> Resolve, then <code>git rebase --continue</code></li>
<li><strong>Abort if needed:</strong> <code>git rebase --abort</code> to undo</li>
</ul></div>
<div style="background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%); padding: 35px; border-radius: 12px; margin: 40px 0; border-left: 5px solid #28a745;">
<h4 style="color: #155724; margin-top: 0; font-size: 1.7em; font-weight: 700;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f3a8.png" alt="🎨" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Autosquash Workflow</h4>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">
# Make fixup commits automatically
git commit --fixup abc1234

# Later, auto-squash them all
git rebase -i --autosquash HEAD~10

# Git automatically marks fixup commits!
</pre>
</p></div>
<blockquote style="background: linear-gradient(to right, #e8eaf6, #c5cae9); border-left: 6px solid #5c6bc0; padding: 40px; margin: 50px 0; border-radius: 12px;">
<p style="font-size: 1.5em; line-height: 1.9; margin: 0; color: #1a237e; font-style: italic; font-weight: 500;">&#8220;Before merge requests, I rebase to 3-5 logical commits. Code reviewers love it. My commit history looks professional. Interactive rebase is mandatory in my workflow now.&#8221;</p>
<footer style="margin-top: 20px; color: #283593; font-size: 1.15em; font-weight: 600;">— Tech Lead, Open Source Maintainer</footer>
</blockquote>
]]></content:encoded>
					
					<wfw:commentRss>http://blog.ercanopak.com/git-use-interactive-rebase-to-clean-up-commit-history/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Git: Use git cherry-pick to Copy Commits Between Branches</title>
		<link>http://blog.ercanopak.com/git-use-git-cherry-pick-to-copy-commits-between-branches/</link>
					<comments>http://blog.ercanopak.com/git-use-git-cherry-pick-to-copy-commits-between-branches/#respond</comments>
		
		<dc:creator><![CDATA[ErcanOPAK]]></dc:creator>
		<pubDate>Thu, 19 Mar 2026 20:07:58 +0000</pubDate>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[Branch Management]]></category>
		<category><![CDATA[Commit Transfer]]></category>
		<category><![CDATA[Copy Commits]]></category>
		<category><![CDATA[git cherry-pick]]></category>
		<category><![CDATA[Git Commands]]></category>
		<category><![CDATA[Git Tips]]></category>
		<category><![CDATA[Git Workflow]]></category>
		<category><![CDATA[Selective Merge]]></category>
		<category><![CDATA[Version Control]]></category>
		<guid isPermaLink="false">http://blog.ercanopak.com/git-use-git-cherry-pick-to-copy-commits-between-branches/</guid>

					<description><![CDATA[Fixed bug in wrong branch. Need same fix in another branch. Don&#8217;t want to merge entire branch. # Switch to target branch git checkout main # Cherry-pick specific commit from other branch git cherry-pick abc1234 # Cherry-pick multiple commits git cherry-pick abc1234 def5678 ghi9012 # Cherry-pick range git cherry-pick abc1234..def5678 Conflicts: If conflict occurs, resolve [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Fixed bug in wrong branch. Need same fix in another branch. Don&#8217;t want to merge entire branch.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="bash"># Switch to target branch
git checkout main

# Cherry-pick specific commit from other branch
git cherry-pick abc1234

# Cherry-pick multiple commits
git cherry-pick abc1234 def5678 ghi9012

# Cherry-pick range
git cherry-pick abc1234..def5678
</pre>
<p><strong>Conflicts:</strong> If conflict occurs, resolve it, then <code>git cherry-pick --continue</code></p>
<p><strong>Abort:</strong> <code>git cherry-pick --abort</code> to cancel.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://blog.ercanopak.com/git-use-git-cherry-pick-to-copy-commits-between-branches/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Git: Use git stash -p to Stash Specific Changes</title>
		<link>http://blog.ercanopak.com/git-use-git-stash-p-to-stash-specific-changes/</link>
					<comments>http://blog.ercanopak.com/git-use-git-stash-p-to-stash-specific-changes/#respond</comments>
		
		<dc:creator><![CDATA[ErcanOPAK]]></dc:creator>
		<pubDate>Thu, 19 Mar 2026 20:07:51 +0000</pubDate>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[Change Management]]></category>
		<category><![CDATA[Git Commands]]></category>
		<category><![CDATA[Git Stash]]></category>
		<category><![CDATA[Git Tips]]></category>
		<category><![CDATA[Git Workflow]]></category>
		<category><![CDATA[Interactive Git]]></category>
		<category><![CDATA[Partial Stash]]></category>
		<category><![CDATA[Selective Stashing]]></category>
		<category><![CDATA[Version Control]]></category>
		<guid isPermaLink="false">http://blog.ercanopak.com/git-use-git-stash-p-to-stash-specific-changes/</guid>

					<description><![CDATA[Made 10 changes. Want to stash only 3. git stash takes everything. # Interactive stash (choose what to stash) git stash -p # Git asks for each change: # Stash this hunk? y/n/q/a/d/e y = yes, stash this n = no, keep this q = quit a = stash all remaining d = don't stash [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Made 10 changes. Want to stash only 3. <code>git stash</code> takes everything.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="bash"># Interactive stash (choose what to stash)
git stash -p

# Git asks for each change:
# Stash this hunk? y/n/q/a/d/e

y = yes, stash this
n = no, keep this
q = quit
a = stash all remaining
d = don't stash any remaining
e = edit hunk manually
</pre>
<p><strong>Use Case:</strong> Debugging changes + feature changes mixed. Stash only debug code, keep feature.</p>
<p><strong>Tip:</strong> Name your stashes: <code>git stash save -p 'debug code'</code></p>
]]></content:encoded>
					
					<wfw:commentRss>http://blog.ercanopak.com/git-use-git-stash-p-to-stash-specific-changes/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Git: Use git reflog to Recover Deleted Commits</title>
		<link>http://blog.ercanopak.com/git-use-git-reflog-to-recover-deleted-commits/</link>
					<comments>http://blog.ercanopak.com/git-use-git-reflog-to-recover-deleted-commits/#respond</comments>
		
		<dc:creator><![CDATA[ErcanOPAK]]></dc:creator>
		<pubDate>Thu, 19 Mar 2026 19:31:47 +0000</pubDate>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[Data Recovery]]></category>
		<category><![CDATA[Git Commands]]></category>
		<category><![CDATA[git reflog]]></category>
		<category><![CDATA[Git Safety Net]]></category>
		<category><![CDATA[Git Tips]]></category>
		<category><![CDATA[lost commits]]></category>
		<category><![CDATA[Undo Changes]]></category>
		<category><![CDATA[Version Control]]></category>
		<guid isPermaLink="false">http://blog.ercanopak.com/git-use-git-reflog-to-recover-deleted-commits/</guid>

					<description><![CDATA[💾 Git&#8217;s Time Machine Accidentally deleted branch? Reset to wrong commit? Reflog saves you. # View all HEAD movements (last 90 days) git reflog # Output shows: # abc1234 HEAD@{0}: reset: moving to HEAD~1 # def5678 HEAD@{1}: commit: Important work ← You want this! # Restore that commit git checkout def5678 git checkout -b recovery-branch [&#8230;]]]></description>
										<content:encoded><![CDATA[<div style="background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); color: white; padding: 40px; border-radius: 12px; margin: 25px 0;">
<h2 style="margin-top: 0; font-size: 2.2em;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4be.png" alt="💾" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Git&#8217;s Time Machine</h2>
<p style="font-size: 1.3em; line-height: 1.8;">Accidentally deleted branch? Reset to wrong commit? Reflog saves you.</p>
</div>
<pre class="EnlighterJSRAW" data-enlighter-language="bash"># View all HEAD movements (last 90 days)
git reflog

# Output shows:
# abc1234 HEAD@{0}: reset: moving to HEAD~1
# def5678 HEAD@{1}: commit: Important work  ← You want this!

# Restore that commit
git checkout def5678
git checkout -b recovery-branch

# Or reset current branch to it
git reset --hard def5678
</pre>
<p><strong>Panic Recovery:</strong> Even after force push, hard reset, branch deletion &#8211; if commit was on your machine, reflog has it.</p>
<p><strong>Time Limit:</strong> Git garbage collects after 90 days. Recover soon!</p>
]]></content:encoded>
					
					<wfw:commentRss>http://blog.ercanopak.com/git-use-git-reflog-to-recover-deleted-commits/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Git: Use git bisect to Find Bug-Introducing Commit in Minutes</title>
		<link>http://blog.ercanopak.com/git-use-git-bisect-to-find-bug-introducing-commit-in-minutes/</link>
					<comments>http://blog.ercanopak.com/git-use-git-bisect-to-find-bug-introducing-commit-in-minutes/#respond</comments>
		
		<dc:creator><![CDATA[ErcanOPAK]]></dc:creator>
		<pubDate>Thu, 19 Mar 2026 19:31:39 +0000</pubDate>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[Binary Search]]></category>
		<category><![CDATA[Bug Detection]]></category>
		<category><![CDATA[Bug Hunting]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[git bisect]]></category>
		<category><![CDATA[Git Commands]]></category>
		<category><![CDATA[Git Tips]]></category>
		<category><![CDATA[Git Tools]]></category>
		<category><![CDATA[Version Control]]></category>
		<guid isPermaLink="false">http://blog.ercanopak.com/git-use-git-bisect-to-find-bug-introducing-commit-in-minutes/</guid>

					<description><![CDATA[🔍 Binary Search for Bugs Bug appeared somewhere in last 100 commits. Which one? Bisect finds it in 7 tries (log₂ 100). git bisect start git bisect bad # Current commit has bug git bisect good abc1234 # This old commit was fine # Git checks out middle commit # You test: does bug exist? [&#8230;]]]></description>
										<content:encoded><![CDATA[<div style="background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); color: white; padding: 40px; border-radius: 12px; margin: 25px 0;">
<h2 style="margin-top: 0; font-size: 2.2em;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f50d.png" alt="🔍" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Binary Search for Bugs</h2>
<p style="font-size: 1.3em; line-height: 1.8;">Bug appeared somewhere in last 100 commits. Which one? Bisect finds it in 7 tries (log₂ 100).</p>
</div>
<pre class="EnlighterJSRAW" data-enlighter-language="bash">git bisect start
git bisect bad              # Current commit has bug
git bisect good abc1234     # This old commit was fine

# Git checks out middle commit
# You test: does bug exist?
git bisect bad   # or git bisect good

# Repeat 5-7 times
# Git finds exact commit that introduced bug
</pre>
<p><strong>Automate:</strong> <code>git bisect run npm test</code> &#8211; runs tests automatically, finds bug without manual testing.</p>
<p><strong>Result:</strong> Find bug-introducing commit in minutes instead of hours of manual checking.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://blog.ercanopak.com/git-use-git-bisect-to-find-bug-introducing-commit-in-minutes/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
