🕷️ Crawler Inspector

URL Lookup

Direct Parameter Lookup

Raw Queries and Responses

1. Shard Calculation

Query:
Response:
Calculated Shard: 67 (from laksa142)

2. Crawled Status Check

Query:
Response:

3. Robots.txt Check

Query:
Response:

4. Spam/Ban Check

Query:
Response:

5. Seen Status Check

ℹ️ Skipped - page is already crawled

đź“„
INDEXABLE
âś…
CRAWLED
8 days ago
🤖
ROBOTS ALLOWED

Page Info Filters

FilterStatusConditionDetails
HTTP statusPASSdownload_http_code = 200HTTP 200
Age cutoffPASSdownload_stamp > now() - 6 MONTH0.3 months ago
History dropPASSisNull(history_drop_reason)No drop reason
Spam/banPASSfh_dont_index != 1 AND ml_spam_score = 0ml_spam_score=0
CanonicalPASSmeta_canonical IS NULL OR = '' OR = src_unparsedNot set

Page Details

PropertyValue
URLhttps://www.endpointdev.com/blog/2012/06/moving-commit-to-another-branch-in-git/
Last Crawled2026-04-15 21:03:49 (8 days ago)
First Indexed2021-10-22 22:18:23 (4 years ago)
HTTP Status Code200
Content
Meta TitleMoving a Commit to Another Branch in Git | End Point Dev
Meta Descriptionnull
Meta Canonicalnull
Boilerpipe Text
Perhaps you’ve made the same mistake I have. You’re right in the middle of developing a feature when a request comes up to fix a different completely unrelated problem. So, you jump right in and fix the issue and then you realize you forgot to start a new git feature branch. Suddenly you realize that you need to merge just the fix you made, but don’t want to merge the commits from the previous feature your working on. Git rocks at manipulating branches and I knew this, but I wasn’t sure how to just move one commit to the master branch. After some digging and a little trial and error, I finally figured it out. This may not be the simplest approach, but it worked for me and wanted to share. The branches I’ll be working with are master and feature. In the current scenario, the feature branch is 4 commits ahead of the master and the branch that I want to bring over is just the most recent. First things first, I need to ensure my master branch is up to date. git checkout master git pull origin master Then I’ll checkout my feature branch and make sure it’s completely up to date with the master branch. git checkout feature git rebase origin/master Next, I’ll create a temporary feature branch that I’ll use later on to bring over the commit that I want. git checkout -b feature_tmp I’ll do the same for master so that I can perform my merging and rebasing in isolation from the master branch. git checkout master git checkout -b master_tmp Now I’m going to merge the two tmp branches so that I have a history that contains all of my commits. This will give me the history that I want, but will include the 3 commits I don’t want. git merge feature_tmp Here’s where the magic happens. I’m going to rebase this branch using interactive mode. I want to rebase everything back to the last commit on the master branch. For simplicity in the commands here, we’ll just use SHA-MASTER in place of the actual SHA1 hash. git rebase -i SHA-MASTER This loads the commits into my editor and from here I just delete the 3 commits that I didn’t want on my master branch. This will give me the history I want with the 4th commit coming right after the last commit on the master branch. After deleting the commits, I just save and quit my editor. Next, I merge my tmp branch into the master branch. git checkout master git merge master_tmp git log Now in the log, I can see the history is in the correct order, just how I wanted it. To finish things up, I’ll just push my changes and then rebase my feature branch which will reorder my commits to match the master branch and place my feature commits as the last three commits in the log. git push origin master git checkout feature git rebase origin/master git log The last thing to do is delete my tmp branches. git branch -D tmp_master git branch -D tmp_feature git
Markdown
[Skip to content](https://www.endpointdev.com/blog/2012/06/moving-commit-to-another-branch-in-git/#main-content) × [Home](https://www.endpointdev.com/) *** [Custom Ecommerce](https://www.endpointdev.com/custom-ecommerce/) [Application Development](https://www.endpointdev.com/application-development/) [Database Consulting](https://www.endpointdev.com/database-consulting/) [Cloud Hosting](https://www.endpointdev.com/cloud-hosting/) [Systems Integration](https://www.endpointdev.com/systems-integration/) [Legacy Business Systems](https://www.endpointdev.com/legacy-business-systems/) [Security & Compliance](https://www.endpointdev.com/security-and-compliance/) [GIS](https://www.endpointdev.com/gis/) *** [Expertise](https://www.endpointdev.com/expertise/) *** [About Us](https://www.endpointdev.com/about/) [Our Team](https://www.endpointdev.com/team/) [Clients](https://www.endpointdev.com/clients/) [Blog](https://www.endpointdev.com/blog/) [Careers](https://www.endpointdev.com/careers/) *** [VisionPort](https://www.visionport.com/) *** [Contact](https://www.endpointdev.com/contact/) [End Point Dev](https://www.endpointdev.com/) [Services](https://www.endpointdev.com/) [Expertise](https://www.endpointdev.com/expertise/) [About](https://www.endpointdev.com/about/) [VisionPort](https://www.visionport.com/) [Contact](https://www.endpointdev.com/contact/) [Custom Ecommerce](https://www.endpointdev.com/custom-ecommerce/) [Application Development](https://www.endpointdev.com/application-development/) [Database Consulting](https://www.endpointdev.com/database-consulting/) [Cloud Hosting](https://www.endpointdev.com/cloud-hosting/) [Systems Integration](https://www.endpointdev.com/systems-integration/) [Legacy Business Systems](https://www.endpointdev.com/legacy-business-systems/) [Security & Compliance](https://www.endpointdev.com/security-and-compliance/) [GIS](https://www.endpointdev.com/gis/) ### DevOps / Cloud - [AI Portal](https://www.endpointdev.com/expertise/ai-portal/) - [AI Tools](https://www.endpointdev.com/expertise/ai-tools/) - [Containers & Virtualization](https://www.endpointdev.com/expertise/containers-virtualization/) - [Deployment Automation](https://www.endpointdev.com/expertise/chef-ansible-puppet/) - [Hosting, Monitoring, and 24x7 Support](https://www.endpointdev.com/expertise/hosting-monitoring/) - [Linux Systems](https://www.endpointdev.com/expertise/linux-systems/) - [Remote Monitoring & Management](https://www.endpointdev.com/expertise/rmm/) - [ROS, Robotics, Embedded Systems](https://www.endpointdev.com/expertise/robotics-embedded-systems/) - [Security, Encryption, Vulnerability Mitigation](https://www.endpointdev.com/expertise/security-encryption/) - [Version Control & DevCamps](https://www.endpointdev.com/expertise/version-control-devcamps/) - [Windows Systems](https://www.endpointdev.com/expertise/windows-systems/) ### Databases - [Benchmarking](https://www.endpointdev.com/expertise/benchmarking/) - [Database Migrations](https://www.endpointdev.com/expertise/migrations/) - [Microsoft SQL Server](https://www.endpointdev.com/expertise/sqlserver/) - [MySQL](https://www.endpointdev.com/expertise/mysql/) - [NoSQL](https://www.endpointdev.com/expertise/nosql/) - [On-site Training and Support](https://www.endpointdev.com/expertise/training-support/) - [PostgreSQL](https://www.endpointdev.com/expertise/postgresql/) - [Replication & Bucardo](https://www.endpointdev.com/expertise/replication/) - [Support and Maintenance Packages](https://www.endpointdev.com/expertise/support-maintenance/) ### Frameworks - [Android & iOS Development](https://www.endpointdev.com/expertise/mobile/) - [ASP, .NET, C\#](https://www.endpointdev.com/expertise/dot-net/) - [CMS (WordPress, Wix, Craft, custom)](https://www.endpointdev.com/expertise/cms/) - [Django & Python](https://www.endpointdev.com/expertise/django-python/) - [Elasticsearch, Solr](https://www.endpointdev.com/expertise/search/) - [Geographic Information Systems](https://www.endpointdev.com/expertise/gis/) - [Java](https://www.endpointdev.com/expertise/java/) - [JavaScript](https://www.endpointdev.com/expertise/javascript/) - [PHP](https://www.endpointdev.com/expertise/php/) - [Ruby on Rails](https://www.endpointdev.com/expertise/ruby-on-rails/) ### Ecommerce - [End Point Ecommerce](https://www.endpointdev.com/expertise/end-point-ecommerce/) - [APIs and Integrations](https://www.endpointdev.com/expertise/apis/) - [Magento](https://www.endpointdev.com/expertise/magento/) - [Payment Processing](https://www.endpointdev.com/expertise/payment/) - [Perl & Interchange](https://www.endpointdev.com/expertise/perl-interchange/) - [Responsive Design](https://www.endpointdev.com/expertise/responsive-design/) - [SEO, Google Ads, Analytics](https://www.endpointdev.com/expertise/analytics/) - [Spree and Solidus](https://www.endpointdev.com/expertise/spree-solidus/) [About Us We design and build custom software solutions.](https://www.endpointdev.com/about/) [Our Team We’re software developers, design thinkers, and security experts.](https://www.endpointdev.com/team/) [Clients Since 1995 we’ve built our reputation by bringing expertise and care to your projects.](https://www.endpointdev.com/clients/) [Blog Ongoing observations by End Point Dev people](https://www.endpointdev.com/blog/) [Careers We currently have no open positions, but check back soon\!](https://www.endpointdev.com/careers/) [Our Blog](https://www.endpointdev.com/blog/) [![](https://www.endpointdev.com/images/icons/rss.svg)](https://www.endpointdev.com/blog/feed.xml) [Search]() [LLM expanded search]() *** [Hide search results](https://www.endpointdev.com/blog/2012/06/moving-commit-to-another-branch-in-git/) ## Moving a Commit to Another Branch in Git [![Mike Farmer](https://www.endpointdev.com/images/people/teampage/mike-farmer.webp)](https://www.endpointdev.com/blog/authors/mike-farmer/) By [Mike Farmer](https://www.endpointdev.com/blog/authors/mike-farmer/) June 21, 2012 Perhaps you’ve made the same mistake I have. You’re right in the middle of developing a feature when a request comes up to fix a different completely unrelated problem. So, you jump right in and fix the issue and then you realize you forgot to start a new git feature branch. Suddenly you realize that you need to merge just the fix you made, but don’t want to merge the commits from the previous feature your working on. Git rocks at manipulating branches and I knew this, but I wasn’t sure how to just move one commit to the master branch. After some digging and a little trial and error, I finally figured it out. This may not be the simplest approach, but it worked for me and wanted to share. The branches I’ll be working with are master and feature. In the current scenario, the feature branch is 4 commits ahead of the master and the branch that I want to bring over is just the most recent. First things first, I need to ensure my master branch is up to date. ``` git checkout master git pull origin master ``` Then I’ll checkout my feature branch and make sure it’s completely up to date with the master branch. ``` git checkout feature git rebase origin/master ``` Next, I’ll create a temporary feature branch that I’ll use later on to bring over the commit that I want. ``` git checkout -b feature_tmp ``` I’ll do the same for master so that I can perform my merging and rebasing in isolation from the master branch. ``` git checkout master git checkout -b master_tmp ``` Now I’m going to merge the two tmp branches so that I have a history that contains all of my commits. This will give me the history that I want, but will include the 3 commits I don’t want. ``` git merge feature_tmp ``` Here’s where the magic happens. I’m going to rebase this branch using interactive mode. I want to rebase everything back to the last commit on the master branch. For simplicity in the commands here, we’ll just use SHA-MASTER in place of the actual SHA1 hash. ``` git rebase -i SHA-MASTER ``` This loads the commits into my editor and from here I just delete the 3 commits that I didn’t want on my master branch. This will give me the history I want with the 4th commit coming right after the last commit on the master branch. After deleting the commits, I just save and quit my editor. Next, I merge my tmp branch into the master branch. ``` git checkout master git merge master_tmp git log ``` Now in the log, I can see the history is in the correct order, just how I wanted it. To finish things up, I’ll just push my changes and then rebase my feature branch which will reorder my commits to match the master branch and place my feature commits as the last three commits in the log. ``` git push origin master git checkout feature git rebase origin/master git log ``` The last thing to do is delete my tmp branches. ``` git branch -D tmp_master git branch -D tmp_feature ``` [git](https://www.endpointdev.com/blog/tags/git/) *** ## Comments Visit the [GitHub issue](https://github.com/EndPointCorp/end-point-blog/issues/655) to view and write comments. ### Popular Tags - [postgres 305](https://www.endpointdev.com/blog/tags/postgres/) - [rails 267](https://www.endpointdev.com/blog/tags/rails/) - [conference 194](https://www.endpointdev.com/blog/tags/conference/) - [database 179](https://www.endpointdev.com/blog/tags/database/) - [ruby 166](https://www.endpointdev.com/blog/tags/ruby/) - [ecommerce 162](https://www.endpointdev.com/blog/tags/ecommerce/) - [javascript 148](https://www.endpointdev.com/blog/tags/javascript/) - [visionport 144](https://www.endpointdev.com/blog/tags/visionport/) - [perl 117](https://www.endpointdev.com/blog/tags/perl/) - [open-source 115](https://www.endpointdev.com/blog/tags/open-source/) - [sysadmin 106](https://www.endpointdev.com/blog/tags/sysadmin/) - [tips 106](https://www.endpointdev.com/blog/tags/tips/) - [All Tags](https://www.endpointdev.com/blog/tags/) *** ### Archive - [Posts by date](https://www.endpointdev.com/blog/archive/) - [Posts by author](https://www.endpointdev.com/blog/authors/) - [Services](https://www.endpointdev.com/) - [Custom Ecommerce](https://www.endpointdev.com/custom-ecommerce/) - [Application Development](https://www.endpointdev.com/application-development/) - [Database Consulting](https://www.endpointdev.com/database-consulting/) - [Cloud Hosting](https://www.endpointdev.com/cloud-hosting/) - [Systems Integration](https://www.endpointdev.com/systems-integration/) - [Legacy Business Systems](https://www.endpointdev.com/legacy-business-systems/) - [Security & Compliance](https://www.endpointdev.com/security-and-compliance/) - [GIS](https://www.endpointdev.com/gis/) - [Expertise](https://www.endpointdev.com/expertise/) - [DevOps / Cloud](https://www.endpointdev.com/expertise/#devops-cloud) - [Databases](https://www.endpointdev.com/expertise/#databases) - [Frameworks](https://www.endpointdev.com/expertise/#frameworks) - [Ecommerce](https://www.endpointdev.com/expertise/#ecommerce) - [About](https://www.endpointdev.com/about/) - [Our Team](https://www.endpointdev.com/team/) - [Clients](https://www.endpointdev.com/clients/) - [Blog](https://www.endpointdev.com/blog/) - [Careers](https://www.endpointdev.com/careers/) - [VisionPort](https://www.visionport.com/) - [Contact](https://www.endpointdev.com/contact/) [![](https://www.endpointdev.com/images/icons/linkedin.png)](https://www.linkedin.com/company/end-point-corporation) [![](https://www.endpointdev.com/images/icons/x-end-point-blue.svg)](https://x.com/endpointdev) [![](https://www.endpointdev.com/images/icons/instagram-end-point-blue.svg)](https://instagram.com/endpointcorporation) © 2026 End Point Corporation
Readable Markdown
Perhaps you’ve made the same mistake I have. You’re right in the middle of developing a feature when a request comes up to fix a different completely unrelated problem. So, you jump right in and fix the issue and then you realize you forgot to start a new git feature branch. Suddenly you realize that you need to merge just the fix you made, but don’t want to merge the commits from the previous feature your working on. Git rocks at manipulating branches and I knew this, but I wasn’t sure how to just move one commit to the master branch. After some digging and a little trial and error, I finally figured it out. This may not be the simplest approach, but it worked for me and wanted to share. The branches I’ll be working with are master and feature. In the current scenario, the feature branch is 4 commits ahead of the master and the branch that I want to bring over is just the most recent. First things first, I need to ensure my master branch is up to date. ``` git checkout master git pull origin master ``` Then I’ll checkout my feature branch and make sure it’s completely up to date with the master branch. ``` git checkout feature git rebase origin/master ``` Next, I’ll create a temporary feature branch that I’ll use later on to bring over the commit that I want. ``` git checkout -b feature_tmp ``` I’ll do the same for master so that I can perform my merging and rebasing in isolation from the master branch. ``` git checkout master git checkout -b master_tmp ``` Now I’m going to merge the two tmp branches so that I have a history that contains all of my commits. This will give me the history that I want, but will include the 3 commits I don’t want. ``` git merge feature_tmp ``` Here’s where the magic happens. I’m going to rebase this branch using interactive mode. I want to rebase everything back to the last commit on the master branch. For simplicity in the commands here, we’ll just use SHA-MASTER in place of the actual SHA1 hash. ``` git rebase -i SHA-MASTER ``` This loads the commits into my editor and from here I just delete the 3 commits that I didn’t want on my master branch. This will give me the history I want with the 4th commit coming right after the last commit on the master branch. After deleting the commits, I just save and quit my editor. Next, I merge my tmp branch into the master branch. ``` git checkout master git merge master_tmp git log ``` Now in the log, I can see the history is in the correct order, just how I wanted it. To finish things up, I’ll just push my changes and then rebase my feature branch which will reorder my commits to match the master branch and place my feature commits as the last three commits in the log. ``` git push origin master git checkout feature git rebase origin/master git log ``` The last thing to do is delete my tmp branches. ``` git branch -D tmp_master git branch -D tmp_feature ``` [git](https://www.endpointdev.com/blog/tags/git/) ***
ML Classification
ML Categoriesnull
ML Page Typesnull
ML Intent Typesnull
Content Metadata
Languageen
Authornull
Publish Timenot set
Original Publish Time2012-06-01 00:00:00 (13 years ago)
RepublishedNo
Word Count (Total)859
Word Count (Content)520
Links
External Links6
Internal Links72
Technical SEO
Meta NofollowNo
Meta NoarchiveNo
JS RenderedNo
Redirect Targetnull
Performance
Download Time (ms)82
TTFB (ms)81
Download Size (bytes)6,921
Shard67 (laksa)
Root Hash15777514137560783467
Unparsed URLcom,endpointdev!www,/blog/2012/06/moving-commit-to-another-branch-in-git/ s443