Tag: git
-
GitHub: The unauthenticated git protocol on port 9418 is no longer supported
GitHub recently improved security, so you may get the error below like I did when I tried to install oh-my-zsh on a new Mac. Anton.Perez@amp ~ % sh -c “$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)” Cloning Oh My Zsh… fatal: remote error: The unauthenticated git protocol on port 9418 is no longer supported. Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more…
-
Git: Command to fix corrupted repository
I occasionally get fatal, such as: error: cannot lock ref ‘refs/remotes/origin/AB-123′: is at dffbe642f088781a5e485227927e141ddb73443a but expected e377921a6d00f4d4c0463774990e03343683177e Rebasing doesn’t work, but if you do the following it will resolve it: git gc –prune=now This guarantees to remove all git garbage. NOTE: Make sure all your code has been committed before doing this.
-
Git How-To: Squash commits in one line
Adding this here in case I need to refer to it in the future. git reset –soft HEAD~3 && git commit Where ~3 means squashing last 3 commits into one.
-
Git: Syncing fork repo against upstream repo
In case you need to make sure your forked repo is up-to-date with the original repo (i.e. /git/original/HelloWorld vs /git/anton/HelloWorld), here’s what you need to do in your terminal: $ git remote -v $ git remote add upstream git@git.url.io:original/HelloWorld.git $ git remote -v $ git fetch upstream $ git checkout master $ git merge upstream/master $…
-
How-to: Git Rebase
Adding here for my own purposes, but may be helpful to others. This rebases to master (or whatever branch) and then squashes all your commits into one commit! Sexy. 🙂 > git fetch –all > git checkout [master] > git pull > git checkout [working branch name] > git merge-base HEAD [master] > git reset…