My .bash_profile For Mac

/ Comments off
  1. My Bash Profile For Mac Colors
  2. My Bash Profile For Mac Permission Denied
  3. Mac Bash Profile Location

I use git from the command line all day long. In the process, I issue a lot of git commands.

This can get (no pun intended) to be a lot of repetitive typing, especially when branch names get long. To illustrate, it’s no fun to type out git checkout feature/shiny-new-processing-system-database-optimization every time I want to checkout that branch. Of course, you can always use the mouse to copy and paste a long branch name rather than typing the whole thing out.

However, if you’re like me and like to keep your hands on the keyboard, this solution can feel slow. Tab completion would certainly be faster and easier.

Unfortunately, the default install of git on some Mac computers doesn’t have tab completion enabled. This was the case for me and at least two of my colleagues. Fortunately, this is an easy fix. There is a bash script that enables tab completion of git commands and branch names. At the time of writing, this exists in git’s official repo on Github. In fact, it is likely that this file already exists on your local machine, but, if you’re reading this post, you probably haven’t tapped into its power, yet. In the rest of this article, I will show you how to enable git tab completion in bash on a Mac. The first step is to figure out whether you already have the git-completion script on your machine.

You can use the command sudo find / -type f -name “git-completion.bash” to see if the script already exists on your local machine. Note: the sudo command will require you to enter the password you use to log in to your Mac. Also, this command may take a minute to run, because it looks through your whole file system. Here are some possible locations for the git-completion script, but it’s okay if it’s somewhere else. Search for:. Follow Blog via Email Enter your email address to follow this blog and receive notifications of new posts by email. Recent Posts.

Archives. Categories. (1). (1). (4).

Aug 3, 2012 - If you're in Terminal all the time, and you regularly type long commands, you can get back those precious moments of your life by creating.

(3). (1). (1). (13).

BashrcMy .bash_profile For Mac

(5). (7). (2). (2). (1). (2).

(2). (2). Meta. Blogs I Follow. January 17, 2019. January 17, 2019. January 17, 2019.

January 17, 2019. January 16, 2019. January 16, 2019. January 16, 2019. January 16, 2019. January 16, 2019. January 16, 2019.

I have a bunch of aliases and environment variables set in my bash profile that aren't being recognized by root. I assume it's because I've only edited the /.profile file and not the system-wide bash profile, but I've already tried editing /etc/profile and it still doesn't work. For example, I have an alias set up so I can just type 'textedit /path/to/file' instead of '/Applications/TextEdit.app/Contents/MacOS/TextEdit /path/to/file.' When I try 'sudo textedit' though, I get 'command not found.' The only way I'm able to get it to work is by logging in as root and sourcing the bash profile from my home folder.

Is there a specific profile for the root account that I have to edit or something? How do I get this to work? This is a question for the Mac OS X Technologies - Unix forum. If you want to edit the root's profile, then sudo su - and edit away, as you will be in the root directory's home directory. But be VERY CAREFUL.

My Bash Profile For Mac Colors

For

My Bash Profile For Mac Permission Denied

If you screw up root, you may find that some system maintenance activities may fail. You would be smarter to maybe create a very unique alias that just sources your /home/username/.profile Another approach is to leave the root.profile alone, and create aliases for commands you want to execute with sudo alias roottextedit='sudo open -a TextEdit ' then you do not need to edit root's.proflie Future Unix questions should be asked in the Mac OS X Technologies - Unix forum. This is a question for the Mac OS X Technologies - Unix forum. If you want to edit the root's profile, then sudo su - and edit away, as you will be in the root directory's home directory. But be VERY CAREFUL.

If you screw up root, you may find that some system maintenance activities may fail. You would be smarter to maybe create a very unique alias that just sources your /home/username/.profile Another approach is to leave the root.profile alone, and create aliases for commands you want to execute with sudo alias roottextedit='sudo open -a TextEdit ' then you do not need to edit root's.proflie Future Unix questions should be asked in the Mac OS X Technologies - Unix forum. @ Bob: Thanks, I actually didn't know there was a Unix forum, but next time I'll make sure I post there. I tried your first suggestion and created a.profile for the root user and it worked until I logged out of the root account. For some reason, using 'sudo textedit' still gives me 'command not found' and I have to log in with 'sudo su -' or 'sudo -i' for it to work. I could just create unique aliases for running things as root like you said, but I still wouldn't be able to use any of my environment variables without logging in as root.

For example, I was trying to build something from source yesterday which needed QT3 and looked at $QTDIR to tell it where to find the QT3 folder. After several failed attempts to build I figured out that when I ran 'sudo make install' it wasn't finding the QT3 folder, so I had to log in as root and source my.profile, then build it.

Mac Bash Profile Location

Obviously I'd rather not have to bother with any of that, I just can't figure out why it doesn't work with sudo. Apple Footer. This site contains user submitted content, comments and opinions and is for informational purposes only. Apple may provide or recommend responses as a possible solution based on the information provided; every potential issue may involve several factors not detailed in the conversations captured in an electronic forum and Apple can therefore provide no guarantee as to the efficacy of any proposed solutions on the community forums. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the.