Search code examples
cygwin

Trying to load .bashrc config file locally


I'd like to create a .bashrc file in my Git Repo which should then be shared with other devs. The goals here is to add project-based aliases for every dev.

For instance when using node.js tools, a lot of them check the current directory for configuration files (ex: grunt looks for Gruntfile.js, JSHint looks for .jshintrc, npm for package.json). I want Cygwin to look after .bashrc in the local directory.

I don't want to change the $HOME variable since it would allow me to only work on one project at a time.


Solution

  • I fixed the issue with aliasas

    1. Run touch .bash_profile command
    2. change file to contain all aliases. Example:

    file .bash_profile

    alias ga='git add --all .'
    alias gp='git push'
    

    Every time you open the Bash, type . .bash_profile to reload the file and therefore register the aliases.