# How to remove unwanted file from last commit
git reset --soft HEAD~1
Then reset the unwanted files in order to leave them out from the commit:
git reset HEAD path/to/unwanted_file
Now commit again, you can even re-use the same commit message:
git commit -c ORIG_HEAD
# How to resolve conflicts
After git rebase "branch"
If you want to accept the changes from the "branch"
git checkout --ours
Or If you want to accept the changes from current branch, just run:
git checkout --theirs
Or
git rebase -s ours
How to fix this error: error: The following untracked working tree files would be overwritten by merge:
git fetch --all
git reset --hard origin/master
# Change the remote
Submodules
=========
g submodule add https://github.com/google/protobuf.git third_party/protobuf
g submodule update --init # to clone all submodules
======
By checking: https://docs.github.com/en/authentication/troubleshooting-ssh/using-ssh-over-the-https-port
which I followed the ~/.ssh/config added the port 443.
and use command like: "proxychains -q git pull", it is working now.
Here is what is working now through https, and through proxy:
❯ proxychains -q ssh -T git@github.com
The authenticity of host '[ssh.github.com]:443 ([20.205.243.160]:443)' can't be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[ssh.github.com]:443' (ED25519) to the list of known hosts.
Hi LeisureLinux! You've successfully authenticated, but GitHub does not provide shell access.