Tag: version control

Collapsing a git repository's history

We have a git project which has quite a big history. Specifically, early in the project there were quite a lot of binary resource files in the project, these have now been removed as they’re effectively external resources. However, the size of our repository is >200MB (the total checkout is currently ~20MB) due to having […]

Whats the difference between git reset –mixed, –soft, and –hard?

I am looking to split a commit up and not sure which reset option to use. I was looking at the page Can you explain what "git reset" does in plain english?, but I realized I don’t really understand what the git index or staging area is and thus the explanations didn’t help. Also the […]

How do you deal with configuration files in source control?

Let’s say you have a typical web app and with a file configuration.whatever. Every developer working on the project will have one version for their dev boxes, there will be a dev, prod and stage versions. How do you deal with this in source control? Not check in this file at all, check it with […]

Git: Is there a way to figure out where a commit was cherry-pick'ed from?

If I cherry-pick from multiple branches, is there a simple way to figure out where the commit was coming from (e.g. the sha of the original commit)? Example: – at master branch – cherry pick commit A from a dev branch – A becomes D at the master branch Before: * B (master) Feature Y […]

To put the prefix ?<revision-number> to codes by Git/Svn

How can you put the prefix ?v=VersionNumber to each file at your repository efficiently by Git/Svn? I found out that SO uses the practise to give version numbers to each specific file in its repo. They use SVN. I would like to know how you can do the same by Git. A few examples. #1 […]

Where does a Git branch start and what is its length?

Every now and then I’m asked, on what commit a certain branch on git starts or if a certain commit has been created on a specific branch. The end point of a branch is pretty clear: that’s where the branch label sits. But – where did it start? The trivial answer would be: on that […]

Can we finally move to DVCS in Corporate Software? Is SVN still a 'must have' for development?

Git/Mercurial have been becoming more and more popular. I have seen plenty of articles comparing SVN with Git/Mercurial, but I am wondering if there is really any reason to still use SVN. It seems like there are plenty of tools for Git/Mercurial now which should help spread its corporate adoption. Are there any reasons to […]

git – skipping specific commits when merging

I’ve been using Git for about a year now and think it’s fantastic, but I’ve just started on a second version of the project and started a new branch for it. I’m struggling a little with the best way to handle things going forward. I have two branches called say master10 (for v1) and master20 […]

How to get back to the latest commit after checking out a previous commit?

I sometimes check out some previous version of the code to examine or test. I have seen instructions on what to do if I wish to modify previous commits — but suppose I make no changes. After I’ve done e.g. git checkout HEAD^, how do I get back to the tip of the branch?.. git […]

git diff between cloned and original remote repository

I have cloned a github repository and made no changes locally. Github repository moved forward with commits on the same branch. How do I find a diff between my local repository and the original github repository? How do I find a diff between my working copy and the original github repository? How do I find […]

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