🕷️ Crawler Inspector

URL Lookup

Direct Parameter Lookup

Raw Queries and Responses

1. Shard Calculation

Query:
Response:
Calculated Shard: 119 (from laksa105)

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
27 days ago
🤖
ROBOTS ALLOWED

Page Info Filters

FilterStatusConditionDetails
HTTP statusPASSdownload_http_code = 200HTTP 200
Age cutoffPASSdownload_stamp > now() - 6 MONTH0.9 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://hpurmann.com/2015/03/28/git-moving-commits-to-another-branch/
Last Crawled2026-03-11 02:50:19 (27 days ago)
First Indexed2018-06-09 10:09:56 (7 years ago)
HTTP Status Code200
Meta TitleMoving commits to another branch
Meta DescriptionLet’s say you made a few commits and then realized that you did them to the wrong branch. Because git is awesome, it’s really easy to change the branch you committed to.
Meta Canonicalnull
Boilerpipe Text
28 Mar 2015 Let’s say you made a few commits and then realized that you did them to the wrong branch. Because git is awesome, it’s really easy to change the branch you committed to. Let’s learn why! Commits Every commit stores the SHA-1 hash of its parent commit(s). Think of it as a directed acyclic graph with each node pointing to its parent(s). Branches A branch is just a pointer to a commit. Git only stores a single file with the filename being the name of the branch. Inside, there is only the SHA-1 of the top-most commit. Or to quote the great book Git Internals : Creating a branch is nothing more than just writing 40 characters to a file. Go for it and have a look in the .git directory of some git repository. $ cd .git $ ls COMMIT_EDITMSG config hooks info objects HEAD description index logs refs $ cd refs/heads $ ls master The folder .git/refs/heads stores the branch reference files. $ cat master eb5c3831d6ebca824857d30cea70948201529ada Let’s say you are on the master branch and create another branch named dev . $ git branch dev $ cat dev eb5c3831d6ebca824857d30cea70948201529ada The new branch dev is pointing to the same commit as master. If we draw that, it would look like this: Back to the problem … With the knowledge of commits and branches you can probably come up with a solution yourself. At this point you noticed that you want commits D and E on a new branch called feature1 . $ git branch feature1 To “remove” the commits from the master branch, you simply move the branch pointer two commits back. Please note the two carets ( ^ ) behind HEAD . $ git reset --hard HEAD^^ Because commits are just referencing their parents, D and E are now unreachable from master . Now you can just switch to your new branch and keep working on it. $ git checkout feature1 I hope you agree with me that this is really easy once you understood what these commands do internally. For further reading, I highly recommend reading the Think-like-a-git website and the mentioned Git Internals book by Peepcode. Written by Hendrik Purmann Berlin-based software engineer. Currently interested in cross functional teams, Microservices, GoLang, Kubernetes and the DevOps movement.
Markdown
# [hpurmann](https://hpurmann.com/) # Moving commits to another branch 28 Mar 2015 Let’s say you made a few commits and then realized that you did them to the wrong branch. Because git is awesome, it’s really easy to change the branch you committed to. Let’s learn why\! ## Commits Every commit stores the SHA-1 hash of its parent commit(s). Think of it as a directed acyclic graph with each node pointing to its parent(s). ![Simple Commits](https://hpurmann.com/assets/graphimages/commit-1.png) ## Branches A branch is just a pointer to a commit. Git only stores a single file with the filename being the name of the branch. Inside, there is only the SHA-1 of the top-most commit. ![Simple branching](https://hpurmann.com/assets/graphimages/commit-2.png) Or to quote the great book [Git Internals](https://github.com/pluralsight/git-internals-pdf): > Creating a branch is nothing more than just writing 40 characters to a file. Go for it and have a look in the `.git` directory of some git repository. ``` $ cd .git $ ls COMMIT_EDITMSG config hooks info objects HEAD description index logs refs $ cd refs/heads $ ls master ``` The folder `.git/refs/heads` stores the branch reference files. ``` $ cat master eb5c3831d6ebca824857d30cea70948201529ada ``` Let’s say you are on the master branch and create another branch named `dev`. ``` $ git branch dev $ cat dev eb5c3831d6ebca824857d30cea70948201529ada ``` The new branch `dev` is pointing to the same commit as master. If we draw that, it would look like this: ![New branch dev](https://hpurmann.com/assets/graphimages/commit-3.png) ## Back to the problem … With the knowledge of commits and branches you can probably come up with a solution yourself. ![Commits on wrong branch](https://hpurmann.com/assets/graphimages/commit-4.png) At this point you noticed that you want commits `D` and `E` on a new branch called `feature1`. ``` $ git branch feature1 ``` ![Create a feature branch](https://hpurmann.com/assets/graphimages/commit-5.png) To “remove” the commits from the master branch, you simply move the branch pointer two commits back. Please note the two carets (`^`) behind `HEAD`. ``` $ git reset --hard HEAD^^ ``` ![Move branch pointer back](https://hpurmann.com/assets/graphimages/commit-6.png) Because commits are just referencing their parents, `D` and `E` are now unreachable from `master`. Now you can just switch to your new branch and keep working on it. ``` $ git checkout feature1 ``` ![Checkout feature1 branch](https://hpurmann.com/assets/graphimages/commit-7.png) I hope you agree with me that this is really easy once you understood what these commands do internally. For further reading, I highly recommend reading the [Think-like-a-git](http://think-like-a-git.net/) website and the mentioned [Git Internals](https://github.com/pluralsight/git-internals-pdf) book by Peepcode. Written by Hendrik Purmann Berlin-based software engineer. Currently interested in cross functional teams, Microservices, GoLang, Kubernetes and the DevOps movement.
Readable Markdown
28 Mar 2015 Let’s say you made a few commits and then realized that you did them to the wrong branch. Because git is awesome, it’s really easy to change the branch you committed to. Let’s learn why\! ## Commits Every commit stores the SHA-1 hash of its parent commit(s). Think of it as a directed acyclic graph with each node pointing to its parent(s). ![Simple Commits](https://hpurmann.com/assets/graphimages/commit-1.png) ## Branches A branch is just a pointer to a commit. Git only stores a single file with the filename being the name of the branch. Inside, there is only the SHA-1 of the top-most commit. ![Simple branching](https://hpurmann.com/assets/graphimages/commit-2.png) Or to quote the great book [Git Internals](https://github.com/pluralsight/git-internals-pdf): > Creating a branch is nothing more than just writing 40 characters to a file. Go for it and have a look in the `.git` directory of some git repository. ``` $ cd .git $ ls COMMIT_EDITMSG config hooks info objects HEAD description index logs refs $ cd refs/heads $ ls master ``` The folder `.git/refs/heads` stores the branch reference files. ``` $ cat master eb5c3831d6ebca824857d30cea70948201529ada ``` Let’s say you are on the master branch and create another branch named `dev`. ``` $ git branch dev $ cat dev eb5c3831d6ebca824857d30cea70948201529ada ``` The new branch `dev` is pointing to the same commit as master. If we draw that, it would look like this: ![New branch dev](https://hpurmann.com/assets/graphimages/commit-3.png) ## Back to the problem … With the knowledge of commits and branches you can probably come up with a solution yourself. ![Commits on wrong branch](https://hpurmann.com/assets/graphimages/commit-4.png) At this point you noticed that you want commits `D` and `E` on a new branch called `feature1`. ``` $ git branch feature1 ``` ![Create a feature branch](https://hpurmann.com/assets/graphimages/commit-5.png) To “remove” the commits from the master branch, you simply move the branch pointer two commits back. Please note the two carets (`^`) behind `HEAD`. ``` $ git reset --hard HEAD^^ ``` ![Move branch pointer back](https://hpurmann.com/assets/graphimages/commit-6.png) Because commits are just referencing their parents, `D` and `E` are now unreachable from `master`. Now you can just switch to your new branch and keep working on it. ``` $ git checkout feature1 ``` ![Checkout feature1 branch](https://hpurmann.com/assets/graphimages/commit-7.png) I hope you agree with me that this is really easy once you understood what these commands do internally. For further reading, I highly recommend reading the [Think-like-a-git](http://think-like-a-git.net/) website and the mentioned [Git Internals](https://github.com/pluralsight/git-internals-pdf) book by Peepcode. Written by Hendrik Purmann Berlin-based software engineer. Currently interested in cross functional teams, Microservices, GoLang, Kubernetes and the DevOps movement.
Shard119 (laksa)
Root Hash8589449272786986719
Unparsed URLcom,hpurmann!/2015/03/28/git-moving-commits-to-another-branch/ s443