To mass remove git branches from a git repository, you can use the following commands:
git branch | grep 'fewald' | xargs git branch -D
git branch: Lists all local branches in the repository.grep 'fewald': Filters the list of branches to only include those that contain the string ‘fewald’.xargs git branch -D: Passes the filtered list of branches to the git branch -D command, which forcefully deletes each branch.
I was looking for a way to speed up my Tensorflow models on my Macbook Pro.
import tensorflow as tf
Switch to a remote branch locally with
git switch <branch>
main locally? This can be undone / reset with
git reset HEAD~1
There are multiple steps required to be able to push/pull from Git repositories with different identities when using SSH Keys.
~/.ssh/config, similar to this example:Host github-identity1.com
HostName github.com
User git
IdentityFile ~/.ssh/identity1
Host github-identity2.com
HostName github.com
User git
IdentityFile ~/.ssh/identity2
git clone github-identity1.com:user/repo.git.
This might sometimes not be enough when pushing to a remote repository.
The reason for this is that multiple identities are added to the ssh-agent.
To obtain the list of added identities, execute ssh-add -l which returns a list of identities.
Those identities will be tried out in order when attempting to push to a remote repository.
If the first one fails, the second one will not be tried, instead the whole push fails.
To fix this, I had to delete all identities via ssh-add -D and then re-add them one by one via ssh-add path/to/private_key.
Installing eventmachine on a new or updated Mac OS can have some challenges. I recently had to reinstall Jekyll after upgrading my personal computer with the latest Mac OS Sequoia. Running bundle install failed with the following error message:
An error occurred while installing eventmachine (1.2.7), and Bundler cannot continue.
In Gemfile:
jekyll-compose was resolved to 0.12.0, which depends on
jekyll was resolved to 4.3.3, which depends on
em-websocket was resolved to 0.5.3, which depends on
eventmachine
Previous Page: 1 of 33 Next