Re: bug report: git push fails in worktree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sorry, you're right I totally forgot some steps. 
I tried to reproduce the error in a Docker Container using the
Dockerfile below:

FROM alpine:latest
RUN apk add git
RUN git clone https://tasadar.net/tionis/test.git /root/test
WORKDIR /root/test
RUN git remote add other-test https://tasadar.net/tionis/other-test.git
RUN git fetch other-test main:other-test
RUN git branch --set-upstream-to=other-test/main other-test
RUN git worktree add /root/other-test other-test
WORKDIR /root/other-test
RUN touch this-is-a-test-file
RUN git config --global user.email "person@xxxxxxxxxxx"
RUN git config --global user.name "Name"
RUN git add .
RUN git commit -m "commit this-is-a-test-file"
CMD ["sh"]

This time git showed me following error message when trying to push:

fatal: The upstream branch of your current branch does not match
the name of your current branch.  To push to the upstream branch
on the remote, use

    git push other-test HEAD:main

To push to the branch of the same name on the remote, use

    git push other-test HEAD

To choose either option permanently, see push.default in 'git help config'.

Following this reference I could resolve my issue by changing the config
using: 
git config push.default upstream

I'm sorry to have wasted your time with this and wish you a nice day.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux