kaberett (
kaberett) wrote in
dw_dev_training2013-05-14 07:43 pm
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
![[site community profile]](https://www.dreamwidth.org/img/comm_staff.png)
Entry tags:
My Exciting Week With Git
I have just pushed what is hopefully the final version of my patch for Bug 5030.
As you can see from comments on that git page, it took quite a lot of editing for me to get it to the final point. This means I ended up running
For tidiness' sake,
fu wanted all of the commits in that branch merged into a single commit using
So, because I ended up doing this several times (and forgetting in between times how I'd done it), here is Wot I Did:
0. Swore a lot and asked for help.
1.
... to check I'm in the branch I want to be.
2.
"-i" means "interactive".
"[X]" needs replacing with the number of commits you had as part of this bug fix. For this bug, I'd got my first commit, in which I'd done most of the work; and my second commit, in which I'd corrected bits and bobs I'd got wrong in the first one, so I replaced "[X]" (in its entirety, including the brackets) with "2".
The interactive rebasing screen is brought up, with a list of the last two commits I made, their ID numbers (not sure what git calls them and I probably should be), and their brief commit messages.
Each line is by default started with "pick". For the first commit I replaced "pick" with "reword" (to allow me to update the commit message); for all subsequent commits I replaced "pick" with "fixup".
3.
Because you've merged everything into one commit, if you try to push without setting
That is a thing that I did! And explained really badly. But at least now there is outline for asking further questions/putting it in the wiki?
As you can see from comments on that git page, it took quite a lot of editing for me to get it to the final point. This means I ended up running
git commit
several times (here's the handy wiki doc).For tidiness' sake,
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
git rebase
.So, because I ended up doing this several times (and forgetting in between times how I'd done it), here is Wot I Did:
0. Swore a lot and asked for help.
1.
git branch
... to check I'm in the branch I want to be.
2.
git rebase -i HEAD~
[X]"-i" means "interactive".
"[X]" needs replacing with the number of commits you had as part of this bug fix. For this bug, I'd got my first commit, in which I'd done most of the work; and my second commit, in which I'd corrected bits and bobs I'd got wrong in the first one, so I replaced "[X]" (in its entirety, including the brackets) with "2".
The interactive rebasing screen is brought up, with a list of the last two commits I made, their ID numbers (not sure what git calls them and I probably should be), and their brief commit messages.
Each line is by default started with "pick". For the first commit I replaced "pick" with "reword" (to allow me to update the commit message); for all subsequent commits I replaced "pick" with "fixup".
3.
git push --force origin
[branchname]Because you've merged everything into one commit, if you try to push without setting
--force
you'll get the error "Updates were rejected because the tip of your current branch is behind its remote counterpart" as you've mergedThat is a thing that I did! And explained really badly. But at least now there is outline for asking further questions/putting it in the wiki?
no subject
Congrats for surviving!
no subject
no subject
no subject