git track branch with different name

前端 未结 2 1791
闹比i
闹比i 2021-02-13 00:33

I have a repo which tracks non-default branches. So, there is a local branch named \"master\" which should track \"origin/master-13.07\". I\'ve done \"push -u\", and I believe i

2条回答
  •  失恋的感觉
    2021-02-13 00:56

    Ok. With the informations you added, I think you simply have to change push.default to value upstream.

    You probably configured the actual value after upgrading Git and seeing this message :

    warning: push.default is unset; its implicit value is changing in 
    Git 2.0 from 'matching' to 'simple'. To squelch this message 
    and maintain the current behavior after the default changes, use: 
    
      git config --global push.default matching
    
    To squelch this message and adopt the new behavior now, use: 
    
      git config --global push.default simple
    

    According to the documentation, value simple must reject a push when branch names are different. See Git Config (search for push.default).

提交回复
热议问题