dotfiles

Adding your .vim ~/.vimrc to github (aka dot files)

跟風遠走 提交于 2019-11-28 03:22:58
I have seen a few people that have git repos with their dot files. I'm wondering if they just cd ~/ git init git add .vimrc // etc ? And then that's how they keep it up to date? Or do they probably make copies and sync them? What strategy do you guys recommend or use? Mostly don't wanna commit and push my entire ~/ Thanks Making a git repository of your home is probably a bad idea (you would be spending more time creating your .gitignore file than on doing what you really want to do). I suggest using a separate git directory for your dotfiles (eg. ~/git/dotfiles ) and them making symlinks to

How to maintain (mostly) parallel branches with only a few difference

穿精又带淫゛_ 提交于 2019-11-27 17:52:57
Scenario: I'm trying to get my unix dot-files under git. I have to work between (at least) the cygwin environment and some standard linux distros (ubuntu and opensuse), and I have files/lines of code that are only specific to, say, cygwin. Since I don't want to checkout useless files or have to deal with lots of cases inside my dotfiles, I'm creating branches for each of my environments. But most of the edits I do are common to all environments, so almost every time I made a commit I need to propagate that change to all my branches. So basically I have several branches that are almost

Can I change the input color of my bash prompt to something different than the terminal default

痞子三分冷 提交于 2019-11-27 14:50:01
My default terminal color is gray, that's fine. My bash prompt displays a bunch of colors, this works fine: PS1="${COLOR_RED}\u${COLOR_WHITE}@${COLOR_RED}${COMPUTERNAME} ${COLOR_BLUE}\w${GITPROMPT} ${COLOR_RESET}" See example: http://cl.ly/image/002f210X1f1u But the text I type in, at the end of the prompt, is gray. I want it to be white (ANSI code "[37m"). If I add a COLOR_WHITE at the end of the prompt, instead of the COLOR_RESET, then the default terminal color changes to white until it is reset. This makes a weird effect of some gray text, with some white text bleeding through at the top.

How to maintain (mostly) parallel branches with only a few difference

有些话、适合烂在心里 提交于 2019-11-27 04:13:56
问题 Scenario: I'm trying to get my unix dot-files under git. I have to work between (at least) the cygwin environment and some standard linux distros (ubuntu and opensuse), and I have files/lines of code that are only specific to, say, cygwin. Since I don't want to checkout useless files or have to deal with lots of cases inside my dotfiles, I'm creating branches for each of my environments. But most of the edits I do are common to all environments, so almost every time I made a commit I need to

How can I grep hidden files?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 00:09:20
问题 I am searching through a Git repository and would like to include the .git folder. grep does not include this folder if I run grep -r search * What would be a grep command to include this folder? 回答1: Please refer to the solution at the end of this post as a better alternative to what you're doing. You can explicitly include hidden files (a directory is also a file). grep -r search * .* The * will match all files except hidden ones and .* will match only hidden files. However this will fail

Adding your .vim ~/.vimrc to github (aka dot files)

孤街浪徒 提交于 2019-11-27 00:01:51
问题 I have seen a few people that have git repos with their dot files. I'm wondering if they just cd ~/ git init git add .vimrc // etc ? And then that's how they keep it up to date? Or do they probably make copies and sync them? What strategy do you guys recommend or use? Mostly don't wanna commit and push my entire ~/ Thanks 回答1: Making a git repository of your home is probably a bad idea (you would be spending more time creating your .gitignore file than on doing what you really want to do). I

What's the difference between Git ignoring directory and directory/*?

三世轮回 提交于 2019-11-26 21:54:40
I'm confused about what's the correct way to ignore the contents of a directory in git. Assume I have the following directory structure: my_project |--www |--1.txt |--2.txt |--.gitignore What's the difference between putting this: www And this? www/* The reason I'm asking this question is: In git, if a directory is empty, git won't include such empty directory in repository. So I was trying the solution that is add an extra .gitkeep file under the directory so that it won't be empty. When I was trying that solution, if in the .gitignore file, I write like below: www !*.gitkeep It doesn't work

Can I change the input color of my bash prompt to something different than the terminal default

瘦欲@ 提交于 2019-11-26 16:54:38
问题 My default terminal color is gray, that's fine. My bash prompt displays a bunch of colors, this works fine: PS1="${COLOR_RED}\u${COLOR_WHITE}@${COLOR_RED}${COMPUTERNAME} ${COLOR_BLUE}\w${GITPROMPT} ${COLOR_RESET}" See example: http://cl.ly/image/002f210X1f1u But the text I type in, at the end of the prompt, is gray. I want it to be white (ANSI code "[37m"). If I add a COLOR_WHITE at the end of the prompt, instead of the COLOR_RESET, then the default terminal color changes to white until it is

What's the difference between Git ignoring directory and directory/*?

两盒软妹~` 提交于 2019-11-26 08:05:04
问题 I\'m confused about what\'s the correct way to ignore the contents of a directory in git. Assume I have the following directory structure: my_project |--www |--1.txt |--2.txt |--.gitignore What\'s the difference between putting this: www And this? www/* The reason I\'m asking this question is: In git, if a directory is empty, git won\'t include such empty directory in repository. So I was trying the solution that is add an extra .gitkeep file under the directory so that it won\'t be empty.