WeBWorK Main Forum

git pull error with OPL

git pull error with OPL

by Lars Jensen -
Number of replies: 1

Dear Colleagues,

When updating webwork-open-problem-library, I get errors. The output of git remote show origin, git pull origin, and git status are included below. What am I missing to update the problem library?


git remote show origin returns:

* remote origin
  Fetch URL: https://github.com/openwebwork/webwork-open-problem-library.git
  Push  URL: https://github.com/openwebwork/webwork-open-problem-library.git
  HEAD branch: main
  Remote branches:
    main                       tracked
    paultpearson-patch-1       tracked
    paultpearson-patch-2       tracked
    paultpearson-patch-3       tracked
    refs/remotes/origin/master stale (use 'git remote prune' to remove)
  Local branch configured for 'git pull':
    main merges with remote main
  Local ref configured for 'git push':
    main pushes to main (local out of date)

git pull origin then returns:

hint: Pulling without specifying how to reconcile divergent branches is
hint: discouraged. You can squelch this message by running one of the following
hint: commands sometime before your next pull:
hint:   git config pull.rebase false  # merge (the default strategy)
hint:   git config pull.rebase true   # rebase
hint:   git config pull.ff only       # fast-forward only
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
remote: Enumerating objects: 147, done.
remote: Counting objects: 100% (104/104), done.
remote: Total 147 (delta 104), reused 104 (delta 104), pack-reused 43
Receiving objects: 100% (147/147), 31.72 KiB | 208.00 KiB/s, done.
Resolving deltas: 100% (114/114), completed with 63 local objects.
From https://github.com/openwebwork/webwork-open-problem-library
   377cfb1036..e724381d37  main       -> origin/main
You asked to pull from the remote 'origin', but did not specify
a branch. Because this is not the default configured remote
for your current branch, you must specify a branch on the command line.

git status returns:

On branch v2022-08-15
Untracked files:
  (use "git add <file>..." to include in what will be committed)

nothing added to commit but untracked files present (use "git add" to track)

In reply to Lars Jensen

Re: git pull error with OPL

by Glenn Rice -

You are on the latest release branch of the OPL.  It is recommended that you just leave it as it is.  Furthermore, you should upgrade with the "OPL-update" script.  Not by running "git pull".  The script will check for new releases for you and take care of fetching it.

However, if you are looking for something that is not in the latest release, the you need to checkout the main branch.  Run "git checkout main" for this.  Then run "git pull". (Note adding "origin" to that command is not needed and usually not even a desirable thing to do.)

You cannot run "git pull" when the release checked out because that is not an actual branch.  The release is a tag.