You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
checkout_pull_branch() to perform a pull, but this doesn't work when the local copy has untracked changes:
Traceback (most recent call last):
File "/pyenv/versions/[redacted]/lib/python3.9/site-packages/pygitops/operations.py", line 193, in get_updated_repo
_checkout_pull_branch(repo, branch)
File "/pyenv/versions/[redacted]/lib/python3.9/site-packages/pygitops/_util.py", line 82, in checkout_pull_branch
origin.pull(branch)
File "/pyenv/versions/[redacted]/lib/python3.9/site-packages/git/remote.py", line 910, in pull
res = self._get_fetch_info_from_stderr(proc, progress,
File "/pyenv/versions/[redacted]/lib/python3.9/site-packages/git/remote.py", line 750, in _get_fetch_info_from_stderr
proc.wait(stderr=stderr_text)
File "/pyenv/versions/[redacted]/lib/python3.9/site-packages/git/cmd.py", line 502, in wait
raise GitCommandError(remove_password_if_present(self.args), status, errstr)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(1)
cmdline: git pull -v origin main
stderr: 'error: Your local changes to the following files would be overwritten by merge:'
Suggested Fix
We could allow an optional force arg to be provided. If set and True, we would pass this option to the git checkout command to discard any changes to the index and working tree. An additional git clean command could also be run to remove untracked files.
The text was updated successfully, but these errors were encountered:
checkout_pull_branch()
to perform a pull, but this doesn't work when the local copy has untracked changes:Suggested Fix
We could allow an optional
force
arg to be provided. If set andTrue
, we would pass this option to thegit checkout
command to discard any changes to the index and working tree. An additionalgit clean
command could also be run to remove untracked files.The text was updated successfully, but these errors were encountered: