Eu utilizo o gitosis para gerenciar os meus repositórios git e dei os meus primeiros passos para configurá-lo da forma correta seguido o tutorial hosting-git-repositories-the-easy-and-secure-way.
Antigamente ao adicionar um repositório novo eu tinha um problema.
Eu seguia todos os passos descritos no tutorial para adicionar um novo repositório, e ao dar um pull eu recebia a seguinte mensagem de erro:
smurf@smurf:~/safernet/projetos/snscripts$ git pull
You asked me to pull without telling me which branch you
want to merge with, and 'branch.master.merge' in
your configuration file does not tell me either. Please
name which branch you want to merge on the command line and
try again (e.g. 'git pull
See git-pull(1) for details on the refspec.
If you often merge with the same branch, you may want to
configure the following variables in your configuration
file:
branch.master.remote =
branch.master.merge =
remote.
remote.
Abrindo o arquivo de configuração do git (.git/config) eu notei que não existiam as informações do branch master que eu estava trabalhando no momento.
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = git@host.com.br:project_name.git
fetch = +refs/heads/*:refs/remotes/origin/*
Então eu editei o arquivo .git/config adicionando as informações do branch master:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = git@host.com.br:project_name.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
Pronto.
Agora será possível dar um pull normalmente.
smurf@smurf:~/safernet/projetos/snscripts$ git pull
Already up-to-date.
Não sei se esta é a melhor forma de resolver o problema, mas é a que eu utilizo.
Espero que seja útil para alguém