Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to avoid exposing secret informations in vimrc when pushing it to Github

Tags:

git

security

vim

I created a new repository in Github to share my vimfiles.

But there's some problems. In the vimrc file, I put some secret informations there to use some plugins.

For example, to use TwitVim( a Twitter client for Vim ), I should add the following codes.

let twitvim_login = "user:pass"

So every time I want to push my vimrc to Github, I have to delete them, and then add them again.

How could I avoid this. Is there any good solution to make this easier?

like image 337
shawjia Avatar asked Jan 05 '11 10:01

shawjia


1 Answers

Create a file called .secretpass and add

let twitvim_login = "user:pass"

in that file, in your .vimrc do;

source .secretpass
like image 117
ismail Avatar answered Nov 03 '22 00:11

ismail