What is the precise meaning of “ours” and “theirs” in git?

This might sound like too basic of a question, but I have searched for answers and I am more confused now than before. What does “ours” and “theirs” mean in git when merging my branch into my other branch? Both branches are “ours”. In a merge conflict is “ours” always the upper of the two […]

What are the differences between local branch, local tracking branch, remote branch and remote tracking branch?

I just started using Git and I got really confused between different branches. Can anyone help me to figure out what the following branch types are? local branches local tracking branches remote branches remote tracking branches What is the difference between them? And how do they work with each other? A quick demo code will […]

How can I prevent git from thinking I did a rename

I have two files index.html and template.html. I moved most of index.html into template.html and now git thinks that I did a rename when I add both files. Is it possible to prevent this in specific cases?

How to REALLY show logs of renamed files with git?

I’m relatively new to git, I used Subversion before. I noticed that most of the graphical git front-ends and IDE plugins don’t seem to be able to display the history of a file if the file has been renamed. When I use git log –follow on the command line, i can see the whole log […]

Using a remote repository with non-standard port

I am setting up my local git project for a remote repository. The remote repository is being served on a non-standard port (4019). But it doesn’t work. Instead I get the following error message: ssh: connect to host git.host.de:4019 port 22: Connection refused fatal: The remote end hung up unexpectedly error: failed to push to […]

Can deleted .git be restored?

This happened when working with git on Ruby on Rails. several commits and branches were done and created. git version I accidentally deleted the .git folder using git -rf .git but I have all the files and updates done on online git-hub repository. I want the .git folder restored. Questions ? Am I totally […]

Git is ignoring files that aren't in gitignore

I have a git repository that is ignoring image files as well as a few other files, but my .gitignore file only has it ignoring a config.php file. Is there some global ignore file somewhere that I can’t seem to find? I have to specify files to add them now, and it’s giving me this […]

Why does Git treat this text file as a binary file?

I wonder why git tells me this:? $ git diff MyFile.txt diff –git a/MyFile.txt b/MyFile.txt index d41a4f3..15dcfa2 100644 Binary files a/MyFile.txt and b/MyFile.txt differ Aren’t they text files? I have checked the .gitattributes and it is empty. Why I am getting this message? I cannot get diffs as I use to anymore ADDED: I’ve noticed […]

Unable to track files within Git submodules

Problem: to add files at ./shells/smallApps/* to Git at ./.git/ when I do not have the files at ./.git/info/exclude nor at any .gitignore -files. This question is based on this tread where the problem is not solved completely. I run $git status ~/bin # On branch master nothing to commit (working directory clean) $git ls-files […]

Show git ahead and behind info for all branches, including remotes

On a github project you can go to a /branches page and se pretty graphs like this one that for each branch show how far behind and how far ahead each branch is with respect to master. Is there a command line tool that does something similar? Something that works with remotes as well? For […]

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