In part I we went through how to use git rebase to modify commit history, things like reword a commit, squash multiple commits, split commit. In this part, we will talk about another common use case of rebase: rebase before merging branches.
Let’s first create a new repo and add one file.txt as the first commit.
apple pear peach cat dog snake Now we create a feature branch from master branch.
Magit is arguably the best Git tool out there and also my favorite. It is a package in Emacs, and it is text based. In this tutorial, we will explore how to use it to tackle one of the more elusive topics in Git: Rebase.
In the beginning there was darkness Let’s create an empty repository and add one empty file to it.
git init touch file.txt git add . git commit -m 'first commit' Rewording commit Now let’s add some fruits in the file.
Being a programmer, you should be very familiar with Fibbonacci numbers. It is often being introduced when teaching recursion.
Tree Recursion Most likely the implementation of a function that calculate fib number is as follows:
(defn fib-tree [n] (cond (= n 0) 0 (= n 1) 1 :else (+ (fib-tree (- n 1)) (fib-tree (- n 2))))) This is just a direct translation from the Fibonacci number definition. Since it is straightforward and easy to understand, most textbooks use it as an typical example for illustrating recursive function.
If you are a programmer, especially backend programmer, sooner or later you will face the problem of storing users' passwords. Even though at first sight this seems like an entry level problem that we should hand over to an intern, it is really not.
If you ask me how to do it. My first answer would be DON’T DO IT! I’m serious, try to avoid it as much as you can, just use Google or Facebook signin and your life goes on.
In previous article, we talked about how to scroll to a certain position in RecyclerView in the test. In this article, we further discuss how to write a custom matcher and use it to scroll the RecyclerView.
Let’s say that we want to scroll to certain item in RecyclerView, but we don’t know the position. We can then create a custom Matcher, and use the matcher to determine which item to scroll to.