
On the other hand, the reference being absolute lets us move the newly cloned repo (within the same filesystem), such that it still refers to its remote.
#GIT CLONE INTO CURRENT DIRECTORY HOW TO#
If the original repo is move relative to the new one, the relative path doesn't help. How to git clone a project and then cd into the newly created directory in one action git clone http//xxx (optional folder name) cd/origrepo # probably doesn't work!Īt best (if it worked) it would allow these two git repos to be moved together as a unit. Even if the reference were relative like this: The fact that the reference is absolute has nothing to do with it. If the remote moves, we have to edit the URL in the config file, or use git remote set-url.

If we move the repo /home/kaz/test/d1/./origrepo then any git operations which access the remote will not work, like git fetch or git ls-remote. git/config file, the reference to the upstream remote is absolute: /home/kaz/test/d1/./origrepo. However, as we can see from the above dump of the. It correctly doesnt set the local config to core.ignorecasetrue, but still isnt completely case sensitive, as status doesnt work. (A "bare" git repository doesn't even have a checked out tree). After cloning into a case sensitive folder (i have identical situation as op with the netfilter headers), git strangely reports 8 changes when I run git status, but no changes when I run git diff or git stash. The actual objects in the git database have abstract names having nothing to do with their path names in the checked out tree. None of the objects in the cloned repo's tree will be absolute or relative to the original directory in any way (unless someone has done something silly, like store absolute symlinks in version control, which are expected to resolve within the tree itself). Warning: You appear to have cloned an empty repository.įetch = +refs/heads/*:refs/remotes/origin/* Initialized empty Git repository in /home/kaz/test/origrepo/.git/

The scoop is basically this: ~/test$ mkdir origrepo The simplest solution is to just replace in the source folder path with forward slashes ( / ): Example: c:devsource will become c:/dev/source.
