Git Tricks to be Dangerous

Git Tricks to be Dangerous

Our Expert content for this week is posted here. You need to become an Expert Member to access it.

In the introductory section, we posted a condensed tutorial of Biopython covering many frequently used functions.

In the intermediate section, we cover metaprogramming in R. Metaprogramming allows you to write code using code. We demonstrate this using a simple example, where many functions like sum1(N)=1+2+3+...+N, sum2(N)=1^2+2^2+....N^2, etc. are generated in one step.

In the advanced tutorial, we go behind the scene of git to see what the commands like “git add” and “git commit” do. The main lesson is that git stores every version of your entire file in a separate tree link maintained by three “objects”. Therefore, if you frequently commit minor changes in a large file, your git folder will grow rapidly, and your git project will take time to download.

Rare situations arise, when you may have submitted sensitive or embarrassing information in the git folder. It is possible to clean up the public git history in such scenarios as described later in the tutorial. Use those commands with extreme caution.

Actually there is a less than rare scenario, where one may want to change your one’s history. The “git config” commands asks for your email address, and the developers may not realize that their precious email addresses would be publicly available for the world to see. Git manual has an example for changing email addresses globally in the entire git repo.

Written by M. //