Show the original branch for a commit

I’ve used git-blame to find a particular commit. Now I want to find the branch that it originally came from. (From there, I’ll use the branch name to find the particular ticket) Let’s define “original branch” as “the branch to which the commit was made before the branch was merged into any other branch”.

Garbage collect commits in git

I have some commits created by git subtree that I want to have garbage collect (more that any practical purpose just to understand what and why can get collected). I have already checked that these commits are not referenced the following ways: # In any reflog > git reflog –all –no-abbrev-commit | grep <hash> (no […]

Getting cmake to run before building after pulling from git

There is this project kept in a git repository, which we build with cmake and ninja. We are using globbing expressions/functions to collect all the source files to be compiled. That means that every time a file is added/removed, cmake has to be called to re-parse the directories. We have seen this is bringing some […]

git ahead/behind info between master and branch?

I have created a branch for testing in my local repo (test-branch) which I pushed to Github. If I go to my Github account and select this test-branch it shows the info: This branch is 1 commit ahead and 2 commits behind master My questions are: How can I display this info locally (ie: a […]

Source Tree Unity project Ghost files

Recently changed my Gitignore which was fine until i pulled down on another machine to find some of the project was not there. So i have switched back to my old git ignore but now as soon as i open the project and go to source tree these files and folders need pushing every time. […]

Remove deleted files from git history

I’m trying to split a subproject off of my git repository. However unlike in Detach (move) subdirectory into separate Git repository I don’t have it in it’s own subdirectory (and moving it in and doing the above only yields the history after the move). I’ve cloned the branch from which I want to split off […]

How to make a git repository read-only?

I have some git repositories accessed remotely through SSH and I want to make some of them read-only to prevent more pushes. Some people have remotes pointing to these repositories. These bare repositories were initialised –shared=group, so is setting file permissions to 660 for all files good enough to still allow SSH access, but disallow […]

Why can't I use TortoiseMerge as my git merge tool on Windows?

I’m trying to perform my first Git merge ever (exciting!), but can’t get Git Gui (0.13.GITGUI from Git 1.7.4.msysgit.0) to recognize TortoiseMerge (1.6.11.20210 x64) on Windows 7. Based on an answer to a similar question, I’ve made the following configuration changes: $ git config –global merge.tool tortoisemerge $ git config –global mergetool.tortoisemerge.cmd ‘TortoiseMerge.exe -base:”$BASE” -mine:”$LOCAL” […]

What would I use git-worktree for?

I read Github’s post on git-worktree. They write: Suppose you’re working in a Git repository on a branch called feature, when a user reports a high-urgency bug in master. First you create a linked working tree with a new branch, hotfix, checked out relative to master […] You can fix the bug, push hotfix, and […]

Do I need to publish to npm every time I update a package available via git?

Say I maintain an incredible crab-season package. I’ve npm published version 0.1.0 with a package.json containing: “repository”: { “type”: “git”, “url”: “https://github.com/example/crab-season.git” } When I add awesome new features, bump the version to 0.2.0, and push to github will the npmjs registry notice my new version or do I need to npm publish each time?

Git Baby is a git and github fan, let's start git clone.