Git error: pathspec 'directoryname' did not match any file(s) known to git. How to solve?

I’m working with a Magento site and anytime I do a git commit * from the application root, the commit fails and prints the following error: error: pathspec ‘media’ did not match any file(s) known to git. There is a media directory in the root of the site and it has been ignored. The global […]

Git post-checkout hook from in repo

I am writing a post-checkout hook for git. I want this hook to be included into the repository and run directly after a fresh clone (as it does). However, I cannot add files to the .git/hooks directory in the repository. Where do add my script in order for git to run it directly after a […]

How to use git pickaxe option with special characters like 'ñ or á' in ANSI encoded files?

I want to find changes on my commits and the word I’m looking for has an accent: Línea. git log -p -SLínea returns no result. How i can escape special characters no git pickaxe option in a ANSI encoded file? Notes: * I’m using Git Bash for windows (Portable Git version 1.9.5) * File is […]

Git: How can I put a commit between older commits without changing the files/folders of later commits?

I have a repository with a series of commits. Lets say two old commits are A and directly after it C: A–C In commit C I have not checked in a new version of the old files, but in fact completely new files with the same name. This makes the diff for commit C look […]

How can I retrieve the local changed files which I wrongly reset in git

Below is the situation which explains what’s the matter about git. I was using the ‘develop’ branch and already made several changes to the local files such as .sql, .java, .js… I made a local branch called ‘develop_some_future’ since my boss wants to confirm my changes before merging main ‘develop’ repository. Apparently my local file […]

How to get back the files removed with `git rm -r -f`?

I did git rm -f -r thinking all the files from the index will be removed but they have been removed from my folder. How do I get my files back?

Double plus sign for the last line in git-diff of merge

Simple conflict situation during git merge. E.g.: index e910fdc,492c972..0000000 @@@ -1,10 -1,5 +1,18 @@@ ++<<<<<<< HEAD +1 +2 +a +4 +5 +6 +b +8 +9 – newnewnew ++newnewnew ++======= + aa + aa + cc + aa -aa ++aa ++>>>>>>> br2 This is diff for not staged both modified file. I’m interested why at the […]

Why `git config -f`command doesn't work with a file of network folder for me?

Git for Windows 2.4.5. It works fine with a local config-file: git config -f “d:\\dev\\settings\\gitconfig.txt” http.proxy http://@proxy2:8080 I need to do the same with a config-file which is located at the network in our domain. This config-file is common for all developers of our company and has common settings (the proxy settings, for example). I […]

Can I send pull request from one repository to another without forking?

I have repository A and repository B in bitbucket Can I send a pull request from rep B to A without using the fork feature? Thanks

Failure to push to remote repo in Git

I do commits into the local repo and it works fine. But when I push to the remote repo it fails: $ git push origin master Everything up-to-date Linux writes ‘Everything up-to-date‘ but in remote repo on github (successfully plugged in with SSH keys) there is only 11 days old stuff. What’s wrong? Update here […]

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