2018-07-23 00:29:40 +00:00
<!doctype html>
< html >
< head >
< meta charset = "utf-8" >
< meta http-equiv = "x-ua-compatible" content = "ie=edge" >
< meta name = "viewport" content = "width=device-width, initial-scale=1, shrink-to-fit=no" >
< meta name = "theme-color" content = "#00cc00" >
2018-08-01 03:51:07 +00:00
< link rel = "icon" type = "image/png" sizes = "192x192" href = "https://tilde.team/apple-touch-icon-precomposed.png" >
< link rel = "icon" type = "image/png" sizes = "96x96" href = "https://tilde.team/favicon-96x96.png" >
2018-07-23 00:29:40 +00:00
2020-02-04 01:12:50 +00:00
< link rel = "stylesheet" href = "https://tilde.team/~ben/gruvbox/gruvbox.css" >
2018-07-23 00:29:40 +00:00
< link rel = "stylesheet" href = "extra.css" >
2018-08-01 03:51:07 +00:00
< link rel = "alternate" type = "application/rss+xml" title = "subscribe to this page..." href = "feed.rss" / >
2018-07-23 00:29:40 +00:00
< title > blog // ~ben — posts tagged "git"< / title >
< / head > < body >
2020-02-04 01:12:50 +00:00
< main >
2018-07-23 00:29:40 +00:00
< div id = "divbodyholder" >
< div class = "headerholder" > < div class = "header" >
< div id = "title" >
< h1 class = "nomargin" > < a class = "ablack" href = "https://tilde.team/~ben/blog/index.html" > blog // ~ben< / a > < / h1 >
< div id = "description" > a blog about tildes and other things< / div >
< / div > < / div > < / div >
< div id = "divbody" > < div class = "content" >
2020-06-27 21:00:05 +00:00
< h3 > < a class = "ablack" href = "default-branch-name.html" >
default branch name
< / a > < / h3 >
<!-- bashblog_timestamp: #202006161518.54# -->
< div class = "subtitle" > June 16, 2020 —
~ben
< / div >
<!-- text begin -->
< p > changing git's default branch name has come up recently as an easy action
we can take to update our language and remove harmful ideas from our daily
usage.< / p >
< p > i'm concerned that this effort to change the language used is ultimately a
symbolic gesture to avoid scrutiny into actual change (notably github's
push for this change and continued contracts with ICE).< / p >
< p > however, it's an easy change to make.< / p >
< p > let's have a look at how to change it for new repos:< / p >
< pre > < code > mkdir -p ~/.config/git/template
echo "ref: refs/head/main" ~/.config/git/template/HEAD
git config --global init.templateDir ~/.config/git/template
< / code > < / pre >
< p > note that you can put this template dir anywhere you like.< / p >
< p > you can also set this system-wide (not just for your user)
in /usr/share, but note that this might get overriden by
package updates.< / p >
< pre > < code > echo "ref: refs/head/main" | sudo tee /usr/share/git-core/templates/HEAD
< / code > < / pre >
< p > the next time you < code > git init< / code > , you'll be on a branch named main.< / p >
< p > to change an existing repo, you can use the < code > -m< / code > switch of < code > git-branch< / code > :< / p >
< pre > < code > git checkout master
git branch -m master main
< / code > < / pre >
< p > push with < code > -u< / code > to your remote if needed and update the default branch in the
repo settings in the hosting platform of choice.< / p >
< p > it's a relatively easy change, but don't kid yourself that it makes any real
impact. go protest, < a href = "
https://blacklivesmatter.carrd.co/">donate and sign petitions< / a > , and get out there to fix the actual problems.< / p >
< p > tags: < a href = 'tag_git.html' > git< / a > , < a href = 'tag_linux.html' > linux< / a > , < a href = 'tag_dev.html' > dev< / a > < / p >
2020-10-28 21:22:09 +00:00
2020-06-27 21:00:05 +00:00
<!-- text end -->
2018-07-23 00:29:40 +00:00
< h3 > < a class = "ablack" href = "dotfiles.html" >
dotfiles
< / a > < / h3 >
<!-- bashblog_timestamp: #201807221926.26# -->
< div class = "subtitle" > July 22, 2018 —
~ben
< / div >
<!-- text begin -->
< p > finally got around to updating my < a href = "https://git.tilde.team/ben/dotfiles" > dotfiles< / a > to use gnu stow.
i adapted < a href = "https://github.com/jamestomasino/dotfiles/blob/master/Makefile" > ~tomasino's makefile< / a >
for use with the configs that i'm keeping with it.< / p >
< p > now i just need to figure out why my ssh config doesn't copy/symlink my config to ~/.ssh when it
already exists.< / p >
< p > tags: < a href = 'tag_linux.html' > linux< / a > , < a href = 'tag_dotfiles.html' > dotfiles< / a > , < a href = 'tag_git.html' > git< / a > < / p >
2018-07-23 00:31:00 +00:00
2018-08-01 03:51:07 +00:00
2018-09-20 22:37:39 +00:00
2018-10-01 04:45:15 +00:00
2018-11-16 18:11:08 +00:00
2019-02-11 07:44:18 +00:00
2019-02-11 07:46:12 +00:00
2019-03-21 03:49:17 +00:00
2020-02-04 01:12:50 +00:00
2020-10-28 21:22:09 +00:00
2018-07-23 00:29:40 +00:00
<!-- text end -->
< h3 > < a class = "ablack" href = "git-remotes-with-ssh-aliases.html" >
git remotes with ssh aliases
< / a > < / h3 >
<!-- bashblog_timestamp: #201801121330.26# -->
< div class = "subtitle" > January 12, 2018 —
ben
< / div >
<!-- text begin -->
< p > did you know that < code > ~/.ssh/config< / code > aliases work for git remotes??< / p >
< p > ~/.ssh/config< / p >
< pre >
Host gh
HostName github.com
User git
IdentityFile ~/.ssh/gh_key
< / pre >
< p > you can now use < code > gh:username/repo< / code > as the remote in place of < code > git@github.com:username/repo< / code > , which is much shorter and easier to type many times!< / p >
< p > < code > git clone gh:benharri/learngit< / code > < / p >
< p > there are many other use cases for the < code > ssh_config< / code > file. for example, here is my config for the tilde machine for easy ssh connections.< / p >
< pre >
Host tilde
HostName tilde.team
User ben
< / pre >
< p > then use < code > ssh tilde< / code > to start a new ssh session. this also works with < code > scp< / code > : try something like this < code > scp file.txt tilde:workspace/.< / code > in place of < code > scp file.txt ben@tilde.team:workspace/.< / code > < / p >
< p > the ssh_config file is super useful. check < code > man ssh_config< / code > for a full list of options!< / p >
< p > tags: < a href = 'tag_git.html' > git< / a > , < a href = 'tag_ssh.html' > ssh< / a > < / p >
2018-07-23 00:31:00 +00:00
2018-08-01 03:51:07 +00:00
2018-09-20 22:37:39 +00:00
2018-10-01 04:45:15 +00:00
2018-11-16 18:11:08 +00:00
2019-02-11 07:44:18 +00:00
2019-02-11 07:46:12 +00:00
2020-10-28 21:22:09 +00:00
2020-02-04 01:12:50 +00:00
2019-03-21 03:49:17 +00:00
2018-07-23 00:29:40 +00:00
<!-- text end -->
< / div >
2020-10-28 20:51:09 +00:00
< div id = "footer" > CC by-nc-nd < a href = "https://tilde.team/~ben/" > ~ben< / a > — < a href = "mailto:ben@tilde.team" > ben@ tilde. team< / a > < br >
2018-09-20 22:37:39 +00:00
generated with < a href = "https://tildegit.org/team/bashblog" > bashblog< / a > , a single bash script to easily create blogs like this one< / div >
2018-07-23 00:29:40 +00:00
< / div > < / div >
2018-09-20 22:37:39 +00:00
< script src = "https://utteranc.es/client.js"
repo="benharri/tilde"
issue-term="title"
crossorigin="anonymous"
2018-10-01 04:45:15 +00:00
theme="github-dark"
2018-09-20 22:37:39 +00:00
async>
< / script >
2020-02-04 01:12:50 +00:00
< / main >
2018-07-23 00:29:40 +00:00
< br >
< / body > < / html >