Skip to content

[bug]: lnk doesn't use the default branch name #14

@xplshn

Description

@xplshn

Steps to reproduce:

  1. lnk init --remote https://github.com/xplshn/dotfiles
  2. touch ~/example
  3. lnk add ~/example
  4. lnk push: ❌ Failed to push changes to remote repository. Please check your network connection and repository permissions.

It doesn't provide the output of git, but my guess is that it is using main for some reason, while the default branch name I use is master

Just capturing the output of git branch once would be enough to be able to always use the correct branch.

But better than that, this could be the opportunity to add the ability to use different branches and easily switch dotfiles

EDIT: Yup, that's the issue.

Image

I modified the line shown in the screen, then did go install and lnk push began working.
I'm not sure if I want to trust lnk, due to, past experiences.
I'm gonna back up my files with a reliable script that I wrote and then try lnk again

Btw, is there any reason why I have to do --recursive? Couldn't it detect folders?

EDIT 2: also did the same for lnk pull (removed the hard-coded "main"). And disregard what I said above about --recursive, I still don't understand why I would want to use --recursive or not, the help text doesn't explain what it means to ""manage" it individually", it just says that it'd do that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions