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 […]
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 […]
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 https://github.com/user/lyricle-new.git ! [rejected] lyricle-frt-backend -> master (non-fast-forward) error: failed to push some refs to ‘https://github.com/user/app.git’ hint: Updates were rejected because a pushed branch tip is behind its remote hint: counterpart. Check […]
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 […]
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?
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://gitorious.org/vimpulse/vimpulse.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 […]
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. […]
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 […]
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?