Does running git init twice initialize a repository or reinitialize an existing repo?

What happens to an existing git repository when you issue git init again? I created a repository with git init. Created a file, add, commit. Check the status (nothing to commit). Then created another file, check the status and I can see it’s untracked as expected. Then, say by mistake, I run git init again […]

Using version control (Git) on a MySQL database

I am a WordPress Designer/Developer, who is getting more and more heavily involved with using version control, notably Git, though I do use SVN for some projects. I am currently using Beanstalk for my remote repo. Adding all of the WordPress files to my repo is no problem, if I wanted to I know I […]

code push to heroku not working

I want to push code on heroku that is on gihub I used the following command git push heroku mybranch:master The error is To ! [rejected] lyricle-frt-backend -> master (non-fast-forward) error: failed to push some refs to ‘’ hint: Updates were rejected because a pushed branch tip is behind its remote hint: counterpart. Check […]

How to skip “Loose Object” popup when running 'git gui'

When I run ‘git gui‘ I get a popup that says This repository currently has approximately 1500 loose objects. It then suggests compressing the database. I’ve done this before, and it reduces the loose objects to about 250, but that doesn’t suppress the popup. Compressing again doesn’t change the number of loose objects. Our current […]

How to pull specific directory with git

I have a project with git, and I just want to clone or pull a specific directory, like myproject/javascript just like subversion does. make some changes, commit and push back again. It’s possible?

What are the “loose objects” that the Git GUI refers to?

When I open the Git GUI, I get a popup message that refers to loose objects. I did git gc and that removed the message. What are loose objects and how could I prevent this from occurring again?

How do I move an existing Git submodule within a Git repository?

I would like to change the directory name of a Git submodule in my Git superproject. Lets suppose I have the following entry in my .gitmodules file: [submodule “.emacs.d/vimpulse”] path = .emacs.d/vimpulse url = git:// What do I have to type to move the .emacs.d/vimpulse directory to .emacs.d/vendor/vimpulse without deleting it first (explained here and […]

how do you push only some of your local git commits?

Suppose I have 5 local commits. I want to push only 2 of them to a centralized repo (using an SVN-style workflow). How do I do this? This did not work: git checkout HEAD~3 #set head to three commits ago git push #attempt push from that head That ends up pushing all 5 local commits. […]

Eclipse git checkout (aka, revert)

Is it possible to do the equivalent of git checkout from within Eclipse using the EGit plugin? I have a file that’s been modified. I want to discards the changes and revert the file back to what’s in the source repository. In Subversion this is called revert. In git the equivalent is checkout. I can’t […]

How to tell if a file is git tracked (by shell exit code)?

Is there a way to tell if a file is being tracked by running some git command and checking its exit code? In other words: is git tracking a file?

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