ℹ️ Skipped - page is already crawled
| Filter | Status | Condition | Details |
|---|---|---|---|
| HTTP status | PASS | download_http_code = 200 | HTTP 200 |
| Age cutoff | PASS | download_stamp > now() - 6 MONTH | 2.4 months ago |
| History drop | PASS | isNull(history_drop_reason) | No drop reason |
| Spam/ban | PASS | fh_dont_index != 1 AND ml_spam_score = 0 | ml_spam_score=0 |
| Canonical | PASS | meta_canonical IS NULL OR = '' OR = src_unparsed | Not set |
| Property | Value |
|---|---|
| URL | https://medium.com/@muh__hizbullah/git-move-commits-to-another-branch-f081bde5c264 |
| Last Crawled | 2026-02-10 04:19:15 (2 months ago) |
| First Indexed | not set |
| HTTP Status Code | 200 |
| Content | |
| Meta Title | Git: Move commits to another branch | by Muhammad Hizbullah | Medium |
| Meta Description | Git: Move commits to another branch Also read this on my website: https://hizbe.vercel.app/blogs/git-move-commits-to-another-branch/ I’ve been make mistake when i working in some project before. I … |
| Meta Canonical | null |
| Boilerpipe Text | Press enter or click to view image in full size
2 min read
Aug 10, 2023
--
Also read this on my website:
https://hizbe.vercel.app/blogs/git-move-commits-to-another-branch/
I’ve been make mistake when i working in some project before. I forgot to switch the branch into development and i working in staging branch where it protected branch. When i want to push to the remote origin i got error message “Protected branch”, and i want to move my commits that i worked in staging branch to the development branch. Here I will share it ho i do that.
Once i in staging branch and we need to know list of our commits id, to do that we can run this command:
git log
example looks of the result of above command like:
after that, you can switch to the branch where it your destination branch such as development branch in my case. We can run this command to switch to the development branch that existed before.
git checkout development
after we switched the active branch, we need to move our commits in staging to development branch, to do that we can run this command:
git cherry-pick commit_id
replace commit_id with your commit id actually, example:
git cherry-pick s4160ca9ffd95589990156cdf1df45103c805253
do it for each commit that you want to move to current active branch.
I hope this can help you, and sorry about my English. I hope you can get me.
Support/Donate:
—
https://trakteer.id/joglodev
—
https://saweria.co/hizbe
—
https://buymeacoffee.com/hizbe
— Subscribe my youtube channel
https://youtube.com/@JogloDev |
| Markdown | [Sitemap](https://medium.com/sitemap/sitemap.xml)
[Open in app](https://play.google.com/store/apps/details?id=com.medium.reader&referrer=utm_source%3DmobileNavBar&source=post_page---top_nav_layout_nav-----------------------------------------)
Sign up
[Sign in](https://medium.com/m/signin?operation=login&redirect=https%3A%2F%2Fmedium.com%2F%40muh__hizbullah%2Fgit-move-commits-to-another-branch-f081bde5c264&source=post_page---top_nav_layout_nav-----------------------global_nav------------------)
[Medium Logo](https://medium.com/?source=post_page---top_nav_layout_nav-----------------------------------------)
[Write](https://medium.com/m/signin?operation=register&redirect=https%3A%2F%2Fmedium.com%2Fnew-story&source=---top_nav_layout_nav-----------------------new_post_topnav------------------)
[Search](https://medium.com/search?source=post_page---top_nav_layout_nav-----------------------------------------)
Sign up
[Sign in](https://medium.com/m/signin?operation=login&redirect=https%3A%2F%2Fmedium.com%2F%40muh__hizbullah%2Fgit-move-commits-to-another-branch-f081bde5c264&source=post_page---top_nav_layout_nav-----------------------global_nav------------------)

Press enter or click to view image in full size
![]()
# Git: Move commits to another branch
[](https://medium.com/@muh__hizbullah?source=post_page---byline--f081bde5c264---------------------------------------)
[Muhammad Hizbullah](https://medium.com/@muh__hizbullah?source=post_page---byline--f081bde5c264---------------------------------------)
2 min read
·
Aug 10, 2023
\--
Listen
Share
Also read this on my website: <https://hizbe.vercel.app/blogs/git-move-commits-to-another-branch/>
I’ve been make mistake when i working in some project before. I forgot to switch the branch into development and i working in staging branch where it protected branch. When i want to push to the remote origin i got error message “Protected branch”, and i want to move my commits that i worked in staging branch to the development branch. Here I will share it ho i do that.
Once i in staging branch and we need to know list of our commits id, to do that we can run this command:
```
git log
```
example looks of the result of above command like:
![]()
after that, you can switch to the branch where it your destination branch such as development branch in my case. We can run this command to switch to the development branch that existed before.
```
git checkout development
```
after we switched the active branch, we need to move our commits in staging to development branch, to do that we can run this command:
```
git cherry-pick commit_id
```
replace commit\_id with your commit id actually, example:
```
git cherry-pick s4160ca9ffd95589990156cdf1df45103c805253
```
do it for each commit that you want to move to current active branch.
I hope this can help you, and sorry about my English. I hope you can get me.
## Support/Donate:
— <https://trakteer.id/joglodev>
— <https://saweria.co/hizbe>
— <https://buymeacoffee.com/hizbe>
— Subscribe my youtube channel <https://youtube.com/@JogloDev>
[Git](https://medium.com/tag/git?source=post_page-----f081bde5c264---------------------------------------)
[Github](https://medium.com/tag/github?source=post_page-----f081bde5c264---------------------------------------)
[Gitlab](https://medium.com/tag/gitlab?source=post_page-----f081bde5c264---------------------------------------)
[Backend](https://medium.com/tag/backend?source=post_page-----f081bde5c264---------------------------------------)
[Frontend](https://medium.com/tag/frontend?source=post_page-----f081bde5c264---------------------------------------)
\--
\--
[](https://medium.com/@muh__hizbullah?source=post_page---post_author_info--f081bde5c264---------------------------------------)
[](https://medium.com/@muh__hizbullah?source=post_page---post_author_info--f081bde5c264---------------------------------------)
[Written by Muhammad Hizbullah](https://medium.com/@muh__hizbullah?source=post_page---post_author_info--f081bde5c264---------------------------------------)
[7 followers](https://medium.com/@muh__hizbullah/followers?source=post_page---post_author_info--f081bde5c264---------------------------------------)
·[9 following](https://medium.com/@muh__hizbullah/following?source=post_page---post_author_info--f081bde5c264---------------------------------------)
Web developer
## No responses yet
[Help](https://help.medium.com/hc/en-us?source=post_page-----f081bde5c264---------------------------------------)
[Status](https://status.medium.com/?source=post_page-----f081bde5c264---------------------------------------)
[About](https://medium.com/about?autoplay=1&source=post_page-----f081bde5c264---------------------------------------)
[Careers](https://medium.com/jobs-at-medium/work-at-medium-959d1a85284e?source=post_page-----f081bde5c264---------------------------------------)
[Press](mailto:pressinquiries@medium.com)
[Blog](https://blog.medium.com/?source=post_page-----f081bde5c264---------------------------------------)
[Privacy](https://policy.medium.com/medium-privacy-policy-f03bf92035c9?source=post_page-----f081bde5c264---------------------------------------)
[Rules](https://policy.medium.com/medium-rules-30e5502c4eb4?source=post_page-----f081bde5c264---------------------------------------)
[Terms](https://policy.medium.com/medium-terms-of-service-9db0094a1e0f?source=post_page-----f081bde5c264---------------------------------------)
[Text to speech](https://speechify.com/medium?source=post_page-----f081bde5c264---------------------------------------) |
| Readable Markdown | Press enter or click to view image in full size
[](https://medium.com/@muh__hizbullah?source=post_page---byline--f081bde5c264---------------------------------------)
2 min read Aug 10, 2023
\--
Also read this on my website: <https://hizbe.vercel.app/blogs/git-move-commits-to-another-branch/>
I’ve been make mistake when i working in some project before. I forgot to switch the branch into development and i working in staging branch where it protected branch. When i want to push to the remote origin i got error message “Protected branch”, and i want to move my commits that i worked in staging branch to the development branch. Here I will share it ho i do that.
Once i in staging branch and we need to know list of our commits id, to do that we can run this command:
```
git log
```
example looks of the result of above command like:
after that, you can switch to the branch where it your destination branch such as development branch in my case. We can run this command to switch to the development branch that existed before.
```
git checkout development
```
after we switched the active branch, we need to move our commits in staging to development branch, to do that we can run this command:
```
git cherry-pick commit_id
```
replace commit\_id with your commit id actually, example:
```
git cherry-pick s4160ca9ffd95589990156cdf1df45103c805253
```
do it for each commit that you want to move to current active branch.
I hope this can help you, and sorry about my English. I hope you can get me.
## Support/Donate:
— <https://trakteer.id/joglodev>
— <https://saweria.co/hizbe>
— <https://buymeacoffee.com/hizbe>
— Subscribe my youtube channel <https://youtube.com/@JogloDev> |
| ML Classification | |
| ML Categories | null |
| ML Page Types | null |
| ML Intent Types | null |
| Content Metadata | |
| Language | en |
| Author | Muhammad Hizbullah |
| Publish Time | 2025-05-18 15:38:59 (11 months ago) |
| Original Publish Time | not set |
| Republished | Yes |
| Word Count (Total) | 320 |
| Word Count (Content) | 248 |
| Links | |
| External Links | 8 |
| Internal Links | 28 |
| Technical SEO | |
| Meta Nofollow | No |
| Meta Noarchive | Yes |
| JS Rendered | No |
| Redirect Target | null |
| Performance | |
| Download Time (ms) | 650 |
| TTFB (ms) | 648 |
| Download Size (bytes) | 25,352 |
| Shard | 77 (laksa) |
| Root Hash | 13179037029838926277 |
| Unparsed URL | com,medium!/@muh__hizbullah/git-move-commits-to-another-branch-f081bde5c264 s443 |