Skip to content

Instantly share code, notes, and snippets.

View NelzkieCoder's full-sized avatar

Nelzkie NelzkieCoder

View GitHub Profile
@NelzkieCoder
NelzkieCoder / work-with-multiple-github-accounts.md
Created December 17, 2023 09:51 — forked from rahularity/work-with-multiple-github-accounts.md
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@NelzkieCoder
NelzkieCoder / jekyll-sorted-category-for-loop-alphabetical-date.liquid
Created November 5, 2017 01:01 — forked from Phlow/jekyll-sorted-category-for-loop-alphabetical-date.liquid
Jekyll (Liquid) for loop to sort posts by category in alphabetical or date-based or similiar order.
{% comment %}
#
# Change date order by adding '| reversed'
# To sort by title or other variables use {% assign sorted_posts = category[1] | sort: 'title' %}
#
{% endcomment %}
{% assign sorted_cats = site.categories | sort %}
{% for category in sorted_cats %}
{% assign sorted_posts = category[1] | reversed %}
<h2 id="{{category[0] | uri_escape | downcase }}">{{category[0] | capitalize}}</H2>