Git: Changes keep getting lost due to seemingly random merges

I have a feeling this will be an obvious answer, but I can’t seem to work it out. What appears to happen is that I commit/push some changes to the server and everything appears fine on my copy. Another developer then pulls from the server from the same branch (allegedly seeing my changes, as far […]

How to amend review issues in Gerrit when there is a second newer review also

Still trying to learn how to use Gerrit and its process. Steps I did where Push first change1 to gerrit for review to HEAD:refs/for/develop Work on something else on same branch and push change2 to gerrit for review to HEAD:refs/for/develop Both commits have gerrit Change-ID lines So now I want to address issue for change1 […]

Connecting to gitosis server through an SSH tunnel

I’ve got an SSH tunnel setup on my macbook, like this… $ ssh -o ServerAliveInterval=3 -N -L 22222:gitosis-server:22 So I can ssh to localhost:22222 and will end up on the gitosis-server behind the firewall. I’ve created a local file, copied it into the gitosis server(running Centos5), and imported it into gitosis using… # […]

Enforcing code standards in git before commit is accepted

Alright, here’s the scenario: A team of developers wants to ensure all new code matches the defined coding standards and all the unit tests are passing before a commit is accepted. Here’s the trick, all of the tests need to run on a dedicated testing machine and we do not have access to modify the […]

Number of commits in a git repository

A 5 month project of mine is nearing its end and as a fan of pointless statistics, I’d like to know how many commits have been made since the repository’s inception. How do I find that out? Notes: I know there is no one repository, I’m just interested in the local version. This is trivial […]

How to resume a git pull/clone after a hung up unexpectedly?

I do a git pull/clone to some repository (mainly github ones). Sometimes after a few minutes the download crashes. Here is a log. remote: Counting objects: 2284, done. remote: Compressing objects: 100% (713/713), done. fatal: The remote end hung up unexpectedlyiB | 5 KiB/s fatal: early EOF fatal: index-pack failed In my following of the […]

Why is git-cvsimport missing one major patchset?

This is a followup to a previous question of mine. I can look through the output of cvsps (saved in my ~/.cvsps directory) and see a patchset for a major, complicated commit. But this commit does not show up when I do cvsimport to update my existing git repository. I know that git-cvsimport will ignore […]

log first 10 in git

Two questions: How to show the first 10 commit in git from beginning to end. (no branch) How the specify the commit index and log it. (show the second or third) I know that git use parent to link the commit, it’s easy to log the commit from end to start. like: git log HEAD~10 […]

What's the difference “origin master” vs “origin/master”

What is the difference between a space and a slash when running git commands? I sometimes see git push origin master (which is a space) and other times I see git rebase origin/master (which uses a slash) What is the difference in this convention? Is it that the slash notation accesses a local cached copy […]

Should git change the ending of line? (control+M or ^M at the end of the first line)

I use git to pull my code from a windows machine. When the other developers pull the files from the server on their liunx machine they have the ^M at the end of the first line. How can make git to take care of this for me? I mean, git should change the ending of […]

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