Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git: Reference at 'refs/heads/master' does not exist #421

Closed
ggiesen opened this issue May 9, 2021 · 5 comments · Fixed by #535
Closed

git: Reference at 'refs/heads/master' does not exist #421

ggiesen opened this issue May 9, 2021 · 5 comments · Fixed by #535

Comments

@ggiesen
Copy link

ggiesen commented May 9, 2021

Environment

  • Python version: 3.6.8
  • Nautobot version: 1.0.1

Steps to Reproduce

  1. Create git repo in GitLab
  2. Assign user with maintainer status
  3. Create personal access token
  4. Add git repository to Nautobot with the following values:
  • Name: nautobot
  • Slug: nautobot
  • Remote URL: https://host.example.com/nautobot.git
  • Branch: master
  • Token: <token>
  • Username: oath2
  • Provides: ["config contexts", "export templates", "jobs"]

Expected Behavior

Clone and sync the repository locally

Observed Behavior

Creating/refreshing local copy of Git repository "nautobot"...
Reference at 'refs/heads/master' does not exist
Error while refreshing nautobot: Reference at 'refs/heads/master' does not exist
Repository synchronization completed in 0 minutes, 0.06 seconds

Manually doing a git pull in Nautobot's local git repository (/opt/nautobot/git/nautobot/ in my case) solves the problem, and allows sync going forward

@FragmentedPacket
Copy link
Contributor

It seems like whatever repo you're attempting to clone down doesn't have a master branch. If it's Nautobot repo, it would be main.

When you're in the local directory and run a git branch, what branches does it show?

@jedelman8
Copy link
Contributor

@ggiesen can you confirm you tried what @FragmentedPacket proposed and if this is still an issue?

@ggiesen
Copy link
Author

ggiesen commented Jun 4, 2021

Still an issue:

$ git branch
* master

The workaround is easy (doing one git pull before initial sync), but yeah, this should be fixed at some point

@smk4664
Copy link
Contributor

smk4664 commented Jun 4, 2021

@ggiesen Was your repo empty at the time you attempted?

@ggiesen
Copy link
Author

ggiesen commented Jun 5, 2021

It may have been empty, though I thought it had at least a README.md.

jathanism added a commit that referenced this issue Jun 16, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants