I have the following git alias in my .gitconfig file.
clone-with-branches = "!cloneWithBranches() { \ git clone $1 $2 ; \ }; cloneWithBranches" I am supposed to use it as follows:
git clone-with-branches folder1 folder2 (supposing that folder1 is valid working git repository that is accessible with its relative path)
when in command line I type,
git clone folder1 folder2 I indeed obtain a clone of folder1 in folder2 but when I used the alias:
git clone-with-branches folder1 folder2 I obtain an error
fatal: repository 'folder1' does not exist. Can anyone tell me what I missed please?
git clone-with-branches, what directory ("folder", but the full path name is important) do you expect thegit cloneto be in when it is run? Note that aliases run from the top level of the work-tree. If that's not what you expect, search for the wordGIT_PREFIXin thegit configdocumentation.