Every Git user will have probably been asked to set up their Git at the first time: git config --global user.name "Ramsay Leung" git config --global user.email ramsayleung@gmail.com The above command will simply add the user.name and user.email value into your ~/.gitconfig file > cat ~/.gitconfig [user] name = Ramsay Leung email = ramsayleung@gmail.com [core] quotepath = false [init] defaultBranch = master You could also specify --local argument to writes the config values to .git/config in whatever project you’re currently in. If you need to simultaneously contribute to your work and open source project on the same laptop, with different Git config values, e.g.(company email address for work-specific projects, personal email address for open source project), what should you do? You could definitely set up work-specific config as global config, then set up personal config with --local for every personal project separately. It works, but tedious and easy to mess-up. Fortunately, starting from Git version 2.13, Git supports conditional configuration includes, you are capable of setting up different configs for different repositories. If you add the following config to your global config file: [includeIf "gitdir:~/projects/oss/"] path = ~/.gitconfig-oss [includeIf "gitdir:~/projects/work/"] path = ~/.gitconfig-work Then Git will look in the ~/.gitconfig-oss files for values only if the project you are currently working on matches ~/projects/oss/. Caution: If you forget to specify the “/” at the end of the git dir, e.g. “~/projects/oss”, Conditional Config won’t work! Therefore, you could have a “work” directory and work-specific config here and an “oss” directory with values for your open source projects, etc. Git also supports other filters more than gitdir, you could specify a branch name as an include filter with onbranch ; include only if we are in a worktree where foo-branch is ; currently checked out [includeIf "onbranch:foo-branch"] path = foo.inc Check out the Git docs for more details
1 Goodbye 2023 As I farewelled to 2023, a year marked by numerous changes and personal evolution, I find myself recollecting the multitude of experiences that unfolded. My 2023 journey was nothing short of fascinating and exciting, prompting me to revisit the year from various angles. After seeing hoards of posts in social media generated by Github Contributions Chart, I thought I could also build an APP to summarize my Github contribution for every year for friends to have fun. I spent my entire 4-days-new-year vocation to build this app named: Github Summary. This project led me through a series of first-time experiences: first time to try Tailwind Css framework, first time to use and deploy project on Vercel, first time to build project on nextjs, first time to develop a public project on React(yes, I’ve tried to learn React for hundreds of times, but never get a chance to use it in real project), etc. 2 Happy 2024 While I hoped I could have completed this project by the close of 2023 to share summaries with friends, life’s timeline had other plans. Now, as we step into 2024, I am thrilled to publish the GitHub Summary. It’s never too late to showcase creative work, and this project is poised to generate insightful summaries not just for the past year but for the adventures that await in 2024. Wishing everyone a Happy New Year! Feel free to explore GitHub Summary: https://github-summary.vercel.app/
1 Goodbye 2023 As I farewelled to 2023, a year marked by numerous changes and personal evolution, I find myself recollecting the multitude of experiences that unfolded. My 2023 journey was nothing short of fascinating and exciting, prompting me to revisit the year from various angles. After seeing hoards of posts in social media generated by Github Contributions Chart, I thought I could also build an APP to summarize my Github contribution for every year for friends to have fun. I spent my entire 4-days-new-year vocation to build this app named: Github Summary. This project led me through a series of first-time experiences: first time to try Tailwind Css framework, first time to use and deploy project on Vercel, first time to build project on nextjs, first time to develop a public project on React(yes, I’ve tried to learn React for hundreds of times, but never get a chance to use it in real project), etc. 2 Happy 2024 While I hoped I could have completed this project by the close of 2023 to share summaries with friends, life’s timeline had other plans. Now, as we step into 2024, I am thrilled to publish the GitHub Summary. It’s never too late to showcase creative work, and this project is poised to generate insightful summaries not just for the past year but for the adventures that await in 2024. Wishing everyone a Happy New Year! Feel free to explore GitHub Summary: https://github-summary.vercel.app/