> From: Trivender Ghangas <trivenderghanga...@gmail.com>
> I am trying to create an alias to simplify the process of cloning a 
> repository with branches. I added alias in C:\Program 
> Files\Git\etc\gitconfig 
> gitconfig : https://www.dropbox.com/s/iumnqmkfk1ua8ty/gitconfig?dl=0
> I am getting error [attached error.png]. I am new to shell scripting. 
> Please help me what is the reason for this error and how I can get around 
> it.

The error is "unexpected end of file".  (You should have transcribed
the command and the error into text.)

It took me a long while to understand this error when it happened to

The critical item in the "bash" manual page is:

       Reserved words are words that have a special meaning to the shell.  The
       following words are recognized as reserved when unquoted and either the
       first  word  of a simple command (see SHELL GRAMMAR below) or the third
       word of a case or for command:

       ! case  do done elif else esac fi for function if in select then  until
       while { } time [[ ]]

The "{" at the beginning of a function definition does not have to be
recognized as a reserved word -- it is recognized for its purpose
because it follows the "()".

But the "}" at the end of a function definition *does* have to be a
reserved word -- and so it must follow a newline or ";".  If it does
not, it is an ordinary word and will not have any of the grammatical
functions that are specified in the bash grammar.

You must change your definition to:

    cloneWithBranches() { git clone $1 $2; cd $2; git checkout-remote-branches; 
git remote rm origin ; }


You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to