Skip to content

Instantly share code, notes, and snippets.

@sahansk2
Created August 15, 2020 03:41
Show Gist options
  • Save sahansk2/2c64aeff1e0edb4a23fc81395a818af5 to your computer and use it in GitHub Desktop.
Save sahansk2/2c64aeff1e0edb4a23fc81395a818af5 to your computer and use it in GitHub Desktop.
newbasics/rebasing -- only solution to reinitialize is to delete the git gud folder :(
sahan@sahan-Lenovo-YOGA-C930-ubuntu:test$ git gud reset
In this file, write a short explanation of the level's goal (e.g. "Merge commits 1 and 2").
<<<<<<< Simulating: git log --graph --oneline --all
* db8237b (HEAD -> master) Added middle
| * d237400 (other) Added ending
|/
* 3f0a9f0 Added intro
=======
sahan@sahan-Lenovo-YOGA-C930-ubuntu:test$ git rebase other
CONFLICT (add/add): Merge conflict in middle.txt
Auto-merging middle.txt
error: could not apply db8237b... Added middle
Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply db8237b... Added middle
sahan@sahan-Lenovo-YOGA-C930-ubuntu:test$ git status
interactive rebase in progress; onto d237400
Last command done (1 command done):
pick db8237b Added middle
No commands remaining.
You are currently rebasing branch 'master' on 'd237400'.
(fix conflicts and then run "git rebase --continue")
(use "git rebase --skip" to skip this patch)
(use "git rebase --abort" to check out the original branch)
Unmerged paths:
(use "git restore --staged <file>..." to unstage)
(use "git add <file>..." to mark resolution)
both added: middle.txt
no changes added to commit (use "git add" and/or "git commit -a")
sahan@sahan-Lenovo-YOGA-C930-ubuntu:test$ git gud reset
Traceback (most recent call last):
File "/home/sahan/.local/bin/git-gud", line 33, in <module>
sys.exit(load_entry_point('git-gud', 'console_scripts', 'git-gud')())
File "/home/sahan/Documents/osai/git-gud-all/git-gud/gitgud/__main__.py", line 523, in main
GitGud().parse()
File "/home/sahan/Documents/osai/git-gud-all/git-gud/gitgud/__main__.py", line 517, in parse
self.command_dict[args.command](args)
File "/home/sahan/Documents/osai/git-gud-all/git-gud/gitgud/__main__.py", line 330, in handle_reset
self.load_level(level)
File "/home/sahan/Documents/osai/git-gud-all/git-gud/gitgud/__main__.py", line 261, in load_level
level.setup()
File "/home/sahan/Documents/osai/git-gud-all/git-gud/gitgud/skills/level_builder.py", line 45, in setup
self._setup()
File "/home/sahan/Documents/osai/git-gud-all/git-gud/gitgud/skills/level_builder.py", line 111, in _setup
file_operator.create_tree(commits, head, details, self.level_dir)
File "/home/sahan/Documents/osai/git-gud-all/git-gud/gitgud/operations.py", line 172, in create_tree
self.repo.delete_head(branch, force=True)
File "/home/sahan/.local/lib/python3.6/site-packages/git/repo/base.py", line 392, in delete_head
return Head.delete(self, *heads, **kwargs)
File "/home/sahan/.local/lib/python3.6/site-packages/git/refs/head.py", line 127, in delete
repo.git.branch(flag, *heads)
File "/home/sahan/.local/lib/python3.6/site-packages/git/cmd.py", line 542, in <lambda>
return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
File "/home/sahan/.local/lib/python3.6/site-packages/git/cmd.py", line 1005, in _call_process
return self.execute(call, **exec_kwargs)
File "/home/sahan/.local/lib/python3.6/site-packages/git/cmd.py", line 822, in execute
raise GitCommandError(command, status, stderr_value, stdout_value)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(1)
cmdline: git branch -D master
stderr: 'error: Cannot delete branch 'master' checked out at '/home/sahan/Documents/osai/git-gud-all/test''
sahan@sahan-Lenovo-YOGA-C930-ubuntu:test$ git gud init --force
Force initializing Git Gud.
Traceback (most recent call last):
File "/home/sahan/.local/bin/git-gud", line 33, in <module>
sys.exit(load_entry_point('git-gud', 'console_scripts', 'git-gud')())
File "/home/sahan/Documents/osai/git-gud-all/git-gud/gitgud/__main__.py", line 523, in main
GitGud().parse()
File "/home/sahan/Documents/osai/git-gud-all/git-gud/gitgud/__main__.py", line 517, in parse
self.command_dict[args.command](args)
File "/home/sahan/Documents/osai/git-gud-all/git-gud/gitgud/__main__.py", line 304, in handle_init
self.load_level(all_skills["0"]["1"])
File "/home/sahan/Documents/osai/git-gud-all/git-gud/gitgud/__main__.py", line 261, in load_level
level.setup()
File "/home/sahan/Documents/osai/git-gud-all/git-gud/gitgud/skills/level_builder.py", line 45, in setup
self._setup()
File "/home/sahan/Documents/osai/git-gud-all/git-gud/gitgud/skills/level_builder.py", line 111, in _setup
file_operator.create_tree(commits, head, details, self.level_dir)
File "/home/sahan/Documents/osai/git-gud-all/git-gud/gitgud/operations.py", line 172, in create_tree
self.repo.delete_head(branch, force=True)
File "/home/sahan/.local/lib/python3.6/site-packages/git/repo/base.py", line 392, in delete_head
return Head.delete(self, *heads, **kwargs)
File "/home/sahan/.local/lib/python3.6/site-packages/git/refs/head.py", line 127, in delete
repo.git.branch(flag, *heads)
File "/home/sahan/.local/lib/python3.6/site-packages/git/cmd.py", line 542, in <lambda>
return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
File "/home/sahan/.local/lib/python3.6/site-packages/git/cmd.py", line 1005, in _call_process
return self.execute(call, **exec_kwargs)
File "/home/sahan/.local/lib/python3.6/site-packages/git/cmd.py", line 822, in execute
raise GitCommandError(command, status, stderr_value, stdout_value)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(1)
cmdline: git branch -D master
stderr: 'error: Cannot delete branch 'master' checked out at '/home/sahan/Documents/osai/git-gud-all/test''
sahan@sahan-Lenovo-YOGA-C930-ubuntu:test$ git gud init --force --pretty-please
Force initializing Git Gud.
Traceback (most recent call last):
File "/home/sahan/.local/bin/git-gud", line 33, in <module>
sys.exit(load_entry_point('git-gud', 'console_scripts', 'git-gud')())
File "/home/sahan/Documents/osai/git-gud-all/git-gud/gitgud/__main__.py", line 523, in main
GitGud().parse()
File "/home/sahan/Documents/osai/git-gud-all/git-gud/gitgud/__main__.py", line 517, in parse
self.command_dict[args.command](args)
File "/home/sahan/Documents/osai/git-gud-all/git-gud/gitgud/__main__.py", line 304, in handle_init
self.load_level(all_skills["0"]["1"])
File "/home/sahan/Documents/osai/git-gud-all/git-gud/gitgud/__main__.py", line 261, in load_level
level.setup()
File "/home/sahan/Documents/osai/git-gud-all/git-gud/gitgud/skills/level_builder.py", line 45, in setup
self._setup()
File "/home/sahan/Documents/osai/git-gud-all/git-gud/gitgud/skills/level_builder.py", line 111, in _setup
file_operator.create_tree(commits, head, details, self.level_dir)
File "/home/sahan/Documents/osai/git-gud-all/git-gud/gitgud/operations.py", line 172, in create_tree
self.repo.delete_head(branch, force=True)
File "/home/sahan/.local/lib/python3.6/site-packages/git/repo/base.py", line 392, in delete_head
return Head.delete(self, *heads, **kwargs)
File "/home/sahan/.local/lib/python3.6/site-packages/git/refs/head.py", line 127, in delete
repo.git.branch(flag, *heads)
File "/home/sahan/.local/lib/python3.6/site-packages/git/cmd.py", line 542, in <lambda>
return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
File "/home/sahan/.local/lib/python3.6/site-packages/git/cmd.py", line 1005, in _call_process
return self.execute(call, **exec_kwargs)
File "/home/sahan/.local/lib/python3.6/site-packages/git/cmd.py", line 822, in execute
raise GitCommandError(command, status, stderr_value, stdout_value)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(1)
cmdline: git branch -D master
stderr: 'error: Cannot delete branch 'master' checked out at '/home/sahan/Documents/osai/git-gud-all/test''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment