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
The following leads to an error being in Exercise_6
# source the helpers.sh file to be able to use its functions
source ../helpers.sh
# init exercise
init_exercise
# Set up remote Git repository
init_repo_remote
git remote add my_remote ../conference_planning_remote
git fetch my_remote
# Create merge conflict with remote
git switch updated_schedules
# Change first event in _schedule_day1.txt_ to "Introduction talk"
git add schedule_day1.txt
git commit -m "Introduction talk"
# Run helper function to commit to the same file remotely
commit_to_remote_by_third_party
# Choose your preferred way of pulling
git config pull.rebase false
git pull
git restore schedule_day1.txt --theirs # or "git restore schedule_day1.txt --ours"
git add schedule_day1.txt
git commit -m "Take remote version"
# Now the local branch is ahead of 'my_remote/updated_schedules' by 2 commits.
git push
The last command leads to the following error message:
Enumerating objects: 8, done.
Counting objects: 100% (8/8), done.
Delta compression using up to 8 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 516 bytes | 516.00 KiB/s, done.
Total 4 (delta 1), reused 0 (delta 0), pack-reused 0
remote: error: refusing to update checked out branch: refs/heads/updated_schedules
remote: error: By default, updating the current branch in a non-bare repository
remote: is denied, because it will make the index and work tree inconsistent
remote: with what you pushed, and will require 'git reset --hard' to match
remote: the work tree to HEAD.
remote:
remote: You can set the 'receive.denyCurrentBranch' configuration variable
remote: to 'ignore' or 'warn' in the remote repository to allow pushing into
remote: its current branch; however, this is not recommended unless you
remote: arranged to update its work tree to match what you pushed in some
remote: other way.
remote:
remote: To squelch this message and still keep the default behaviour, set
remote: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To ../conference_planning_remote
! [remote rejected] updated_schedules -> updated_schedules (branch is currently checked out)
error: failed to push some refs to '../conference_planning_remote'
How would one do this correctly?
The text was updated successfully, but these errors were encountered:
The following leads to an error being in Exercise_6
The last command leads to the following error message:
How would one do this correctly?
The text was updated successfully, but these errors were encountered: