git : remote HEAD is ambiguous - how to push changes to another branch than the cloned one? -


i cloned remote rep, master , made changes. before pushing changes admin has created development branch.

now "git remote show origin" command showing following ambiguous head branch.

  head branch (remote head ambiguous, may 1 of following):     development     master   remote branches:     development new (next fetch store in remotes/origin)     master      tracked   local branch configured 'git pull':     master merges remote master   local ref configured 'git push':     master pushes master (up date) 

i made changes cloned master. now, how push changes newly created development branch ?

thanks

if want have local branch called development "linked" remote development branch, current state (eg : master branch commits), run :

# create new branch on current commit, , switch : $ git checkout -b development    # push moidifcations remote "development" branch, # , tag local branch follow remote "development" branch : $ git push --set-upstream origin development 

if want push remote branch :

git push origin mylocalbranch:remotebranch # example : git push origin master:development  # if add '-u' or '--set-upstream', local branch # follow remote branch : git push -u origin mylocalbranch:remotebranch 

Comments

Popular posts from this blog

android - net_scheduler holding wakelock -

sql - MySQL : Getting Entries from a many-to-many table -

java - Retrieving data from database using jsp (Hibernate + Spring + Maven) -