git commit after you made
git branch, you continue to work, until you do
git merge and even
git push. There are thousands of tutorials like that, but you don't know the upcoming hustle that will be with your git branch, so usually in development of some big products,
git branch is omitted and corporations don't usually trust novice developers on how to work with the branch, since they don't know how to clean up.
In this tutorial we will continue to learn git, assuming you learnt basics from others and since destruction guaranteed, please create a NEW-fresh-copy of your git local repository directory & please start working on it until you learn and master all the basics that are here.
So first of all, before you apply the changes and get disappointed from results, be aware you might get a nasty git graph history with TONs of branches, which are easily deleted by just doing
git push -force, the reason is that git apps are doing fetch every few minutes or even evert few seconds and the later results once you create a local change is an ugly-ugly tree.
When you are working on redrawing git history graph tools view, you might probably want on the first to learn how to detach tail of a branch and re-attach head of a branch, doing un-merge and re-commit it into a new, another branch.
In order to make the existing branch which looks messy to be a child of another branch, you pick up the old parenting pointing commit (paste it in <oldparent>), choose the new parenting point you wish the branch to start from and paste there the new commit in <newparent> & yeas the order IS correct git rebase new old.
git rebase --onto <newparent> <oldparent>
listening to Екатерина Яшникова - Самолёт. Attention, Russian Language!
Guys, please take a moment to read this.
There are no brief tutorials on this this topic anywhere, I'm trying to make it accessible for everyone and since I don't have any sponsors, nor experience with SEO this article is not getting any traffic. Please help us the word and let other developers who wish to learn outside the corporate the hottest bid you can place on git and share this article. The tutorial will be finished once it gets 10 reactions.
To those of you who are reading my article, here is the second piece as I promised for the tutorial.
Getting into git redraw for history commits involves taking a tail, attaching it to another branch which is done with
git rebase --onto and taking a "head" of a branch, disconnecting it from merge and possibly connecting it to another branch, and this is done with
In the stack overflow above question, these guys clearly state, first move to the branch you want attach the head to (they call it commit, since it is available for any level and not only to head of branch) and then run
git cherry-pick <hash>.
Well, first of all when you are redrawing history, you'll probably want to to dettach everything from the first branch you choose you are working on and you will simply "put" it in a place you need, so for instance you'd say "take all the branches on release A at commit A1 and tail them all from here as features, merging them into git master at the top tree". That means that if you have messy branches, you do
git rebase --onto and create a new tail for everyone, making for instance one starting point for all, but your heads will still be messy, so you can just
git checkout master and
git cherry-pick <commit> for the commits of the messy kinds you had.
So this is the command line:
git checkout <branch> #normally master git cherry-pick <commit> #this is what you want to 'merge' to master
And normally you end up in something like this:
#dirty commits with real work you were working on #push #SURPRISE #REDRAW HISTORY BEGINS HERE: git rebase --onto ... #we state the begin points for git branch tails... git rebase --onto ... #git reverts, usually something's broken but it's git so it's no lost. git checkout master git cherry-pick <commit> #we painted tails, now we paint heads.
I know this is not straight forward, but to get the real job done, you should copy paste your project, create a new feature using branches and if you have one, just repaint the history on a clone of your project. Trust me. This is worth the price of time consumed.
The PROS of this tutorial is that it states exactly what commands you need to do what you're wanting to do for a long time, the CONS is that there are no picture. I was planning to make it for too long and maybe just I need to get refreshes and make series of the exact same tutorials over time, targeting different people and different audiences. Thank you so much for your time and please share us your thought in comments.