惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

有赞技术团队
有赞技术团队
M
MIT News - Artificial intelligence
Hugging Face - Blog
Hugging Face - Blog
博客园 - 聂微东
量子位
S
SegmentFault 最新的问题
V
Visual Studio Blog
博客园 - 【当耐特】
Apple Machine Learning Research
Apple Machine Learning Research
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
小众软件
小众软件
Stack Overflow Blog
Stack Overflow Blog
Vercel News
Vercel News
D
Docker
J
Java Code Geeks
博客园 - 三生石上(FineUI控件)
博客园 - Franky
Recent Announcements
Recent Announcements
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
MongoDB | Blog
MongoDB | Blog
D
DataBreaches.Net
Y
Y Combinator Blog
云风的 BLOG
云风的 BLOG
V
V2EX

blag

SQLite prefixes its temp files with `etilqs_` - blag Setsum - order agnostic, additive, subtractive checksum - blag Oldest recorded transaction - blag Replacing a cache service with a database - blag SQLite commits are not durable under default settings - blag PSA: SQLite WAL checksums fail silently and may lose data - blag Rickrolling Turso DB (SQLite rewrite in Rust) - blag Collection of insane and fun facts about SQLite - blag How bloom filters made SQLite 10x faster - blag In search of a faster SQLite - blag Galloping Search - blag Building a distributed log using S3 (under 150 lines of Go) - blag Zero Disk Architecture - blag PSA: Most databases do not do checksums by default - blag PSA: SQLite does not do checksums - blag Disaggregated Storage - a brief introduction - blag Why does SQLite (in production) have such a bad rep? - blag SQLite Slaps - blag Now - blag Learning C - blag Snapshot Testing - blag Win: contribution to libSQL (SQLite) codebase - blag Errata in Hekaton MVCC paper - blag Internet is wholesome: MVCC edition - blag It is becoming difficult for me to be productive in Python - blag MongoDB secondary only index - blag Introducing CaskDB – a project to teach you writing a key-value store - blag Recurse Center: Winter Break - blag Recurse Center Day 24: Hacking Go compiler to add a new keyword - blag Recurse Center Day 20: Django v4 upgrade (from v1) - blag
How I Am Maintaining Multiple Emails For Git On A Same Ma...
2015-08-02 · via blag

Every git commit is associated with two important data: your name and email. I don’t want my personal email address associated with work related git commits and vice versa. First, to set the git email address system wide, you would run following:

$git config --global user.email "[email protected]"
$git config --global user.name "Your Name"

and every commits will have above info. To set the email address for individual repo, just drop the global. cd into your repository and run the following:

$git config user.email "[email protected]"
$git config user.name "Your Name"

Now every commit for this repository will have above email. There is another way, by modifying .git/config of your repository and including a [user] block, something like:

[core]
    ...
[remote "origin"]
    ...
[branch "master"]
    ...
[user]
    name = Your Name
    email = [email protected]

Problems

Though above mentioned methods work, there are two major issues (at least for me):

  1. You have to run the above command everytime you create a new repository.
  2. You have to remember #1.

#2 is actually difficult for me.

Solution

Use direnv. direnv is one nifty tool which lets you have different environment variables based on directories/path. The best part is, as soon as you enter into a directory, direnv does it’s magic, so you don’t have to remember that you have to run direnv. For direnv to work, you have to create a file called .envrc where you can specify what all environment variables you want and place it the directory.

This is how I have organized my repositories:

~/
|- work # all work related repos go here
    |-- .envrc
    |-- repo-1
    |-- ...
    |-- repo_X
|- Documents/code # all my personal projects go here
    |-- .envrc
    |-- repo-1
    |-- ...
    |-- repo_X

So, my ~/work/.envrc contains:

export GIT_AUTHOR_EMAIL="[email protected]"
export GIT_COMMITTER_EMAIL="[email protected]"

similarly, my ~/Documents/code/.envrc contains:

export GIT_AUTHOR_EMAIL="[email protected]"
export GIT_COMMITTER_EMAIL="[email protected]"

Before each prompt direnv checks for .envrc in current directory and parent directories. And when the file is found, it applies those and those variables will be present in your shell. You can also add GIT_AUTHOR_NAME or GIT_COMMITTER_NAME if you want to use different names in git commits.

References: