Git: pre-receive hook to allow only merges and not direct commits into master

I have a problem creating a pre-receive hook on a git remote branch, doing what I want. What’s the problem? Direct commits to the master branch should be not allowed. Only merges into the master branch should be allowed. Solution My solution until now is to check, if there are changes in the push from […]

Where is the .git repository stored on Microsoft TFS 2015

I have a new TFS 2015 server which we’re using with Git, and I need to ensure that it is backed up properly. In a standard TFS server, I’d just back up the SQL server database to ensure that the TFS is backed up. In a standard .Git “server”, I’d back up the .git directory […]

Definitively delete the tracking of .DS_Store files in GIT

This question already has an answer here: How to make Git “forget” about a file that was tracked but is now in .gitignore? 15 answers

Git branch/tag name with ^{}

Running the command git ls-remote lists the following entries: e6c1ddea6ee8eefa9e96e349dd4fad4a48c16448 refs/tags/1.1 1a3b5ae3a50ca2f24e5cd917cbf51d371f1dd01e refs/tags/1.1^{} 81901877c5add523cd4a4bb8f51ad3bbbacbd686 refs/tags/1.2 4681b1ae6ec71301019da13d1790c2f808c2c553 refs/tags/1.2^{} What does the ^{} mean in the output?

Is there a way to add a hidden folder (with . prefix) to SourceTree?

I’m using Spacemacs on OS X. I want to add the folder .emacs.d to SourceTree since it’s clone of a git repo. However I can’t even locate any hidden folder from SourceTree -> File -> Open. Does that mean I’ll have to rely on some other git interface?

GitHub for Windows says that there are uncommited changes even though the diffs are empty

I am using the GitHub for Windows client, now it seems to state that there are uncommited changes even though the diffs are empty. I already tried to commit the empty diffs but i still get the same thing over and over again. I typed git status in the Shell and this is what I […]

From master, commit to another branch

I usually create branches for the different segments of code but once in a while I forget to create a new branch and everything is happening on the master branch. How can I say to git that although I am on the master branch, this commit is for the xyz branch?

git request-pull from local branch to remote master

I really love the github pull-request method for collaboration on distributed software development. It allows discussion and code review. My goal is to use the same flow but inside our repository without github. I don’t want to fork the project. Lets imagine, I develop an awesome feature locally. And I want to make a pull […]

In git, what is the difference between long and short hashes?

Here is the long git hash: commit c26cf8af130955c5c67cfea96f9532680b963628 Merge: 8654907 37c2a4f Author: nicolas Date: Wed Apr 26 13:28:22 2017 -0400 Here is the short one

create a new svn branch with git-svn

While working with git-svn, and a ‘typical’ svn repo /trunk, /branches/…, /tags/… How do I push a local branch to a new branch inside of /branches ?

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