How to reparent in Git

These all look like applications of git rebase –onto. 1a. Reparenting I Before: A—B—C—D After: C’—D’ / A—B Set up branches to label the particular commits and then rebase onto. git checkout -b ex1a-b B git checkout -b ex1a-d D git checkout -b ex1a-a A git rebase –onto ex1a-a ex1a-b ex1a-d 1b. Reparenting II Before: … Read more

git: command not found (on OS X 10.5)

From the page you linked to: /usr/local/git/bin Is that in your PATH? Open ~/.profile in your favorite editor and add the line export PATH=$PATH:/usr/local/git/bin This appends the item to your PATH variable (separarated by colons), so it’s compatible with other commands that modify the path.

git diff – only show which directories changed

You could use git-diff with the –dirstat parameter. In your scenario, let’s say you have the following commit: $ git diff –name-status HEAD~1 M subtool/file1 M subtool/file2 M subtool3/file1 It would produce the following output: $ git diff –dirstat=files,0 HEAD~1 66.6% subtool/ 33.3% subtool3/ Make sure to add ,0, otherwise git diff will by default … Read more

Other consequences of `git push –force`?

To complement torek’s excellent answer: A force-push can cause problems with later merges. The problem: If you force-push a branch A, you are removing some existing commits from that branch (otherwise you would not need to force). If (as described in torek’s answer) these commits are also referenced from another branch B, then they will … Read more

Difference between Git and Nexus?

There are both referential: one (Git) is a source referential for version control (with features like merging, branching, tags) the other (Nexus) is an artifact referential for any delivery (binaries or not) The referential database differs also: Git has its own internal repository storage mechanism Nexus is simply a collection of shared directories with a … Read more

Semi linear merge

Semi-linear merge This strategy is the most exotic – it’s a mix of rebase and a merge. First, the commits in the pull request are rebased on top of the master branch. Then those rebased pull requests are merged into master branch. It emulates running git rebase master on the pull request branch, followed by … Read more

Limiting file size in git repository

As I was struggling with it for a while, even with the description, and I think this is relevant for others too, I thought I’d post an implementation of how what J16 SDiZ described could be implemented. So, my take on the server-side update hook preventing too big files to be pushed: #!/bin/bash # Script … Read more