TheLocehiliosan / yadm

Yet Another Dotfiles Manager
https://yadm.io/
GNU General Public License v3.0
4.92k stars 176 forks source link

Invalid push instructions #391

Closed mauro-balades closed 1 year ago

mauro-balades commented 2 years ago

This issue is about

Describe the issue

Screenshot_20211212_120129

These are actually wrong since you will need to add this command before pushing:

yadm branch -M master

because if not, git will return this error:

error: src refspec main does not match any
error: failed to push some refs to '...'
github-actions[bot] commented 2 years ago

This issue has been labeled as stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

costis-t commented 2 years ago

This is correct. yadm branch -M master is needed, but then I received more errors from yadm/github (waiting for a file to close, and a src refspec). I believe two changes need to take place:

  1. Control that the EDITOR exists, and
  2. allow other names for branches. (It doesn't seem to work with yadm branch -M main but -M master works fine.)

I explain more below but the above is my take away. I use zsh and I was testing something in bash but my bash profile had EDITOR=/usr/bin/nano. I do not use this editor as in the file /usr/bin/nano does not even exist. I was getting another message from yadm after commiting, saying that it waiting to close the file, but it never seemed to open it in the first place (!). Anyway, "git config --global core.editor "/usr/bin/vim" fixed my issue at that moment. Then, I was trying with -M main but was getting a error: src refspec master does not match any error. With the master branch it worked fine.

mauro-balades commented 2 years ago

This is correct. yadm branch -M master is needed, but then I received more errors from yadm/github (waiting for a file to close, and a src refspec). I believe two changes need to take place:

1. Control that the EDITOR exists, and

2. allow other names for branches. (It doesn't seem to work with `yadm branch -M main` but `-M master` works fine.)

I explain more below but the above is my take away. I use zsh and I was testing something in bash but my bash profile had EDITOR=/usr/bin/nano. I do not use this editor as in the file /usr/bin/nano does not even exist. I was getting another message from yadm after commiting, saying that it waiting to close the file, but it never seemed to open it in the first place (!). Anyway, "git config --global core.editor "/usr/bin/vim" fixed my issue at that moment. Then, I was trying with -M main but was getting a error: src refspec master does not match any error. With the master branch it worked fine.

I think the error (error: src refspec master does not match any) just happens because your repository does not contain that specific branch.

costis-t commented 2 years ago

I think the error (error: src refspec master does not match any) just happens because your repository does not contain that specific branch.

Exactly that. One might have dotfiles with slight different changes (say per user, or host), so having different branches would help that one, that certainly is not me. :D

TheLocehiliosan commented 2 years ago

What version of yadm & Git are you using?

The most recent versions of yadm & Git will create a "master" branch by default. (unless you provide the --initial-branch option or have the config init.defaultBranch defined)

Please write up the steps you've taken to produce this error.

Also, when the error occurs, what is the output of:

yadm show-ref

github-actions[bot] commented 2 years ago

This issue has been labeled as stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

mauro-balades commented 2 years ago

f

github-actions[bot] commented 1 year ago

This issue has been labeled as stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 1 year ago

This issue was closed because it has been labeled as stale for 7 days with no activity.