Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools GitHub Basics Working By Yourself Push Your Project to GitHub

Christopher Lebbano
Christopher Lebbano
15,338 Points

I set up the dotfiles from her github and it seems to have broken my terminal...

So I wanted to tryout her dotfiles in my ubuntu terminal. After following her readme.md steps, the terminal no longer recognizes any git commands. If I type in "git" it thinks I'm typing in "hub". What is going on? How can I reverse this?

http://imgur.com/a/TIvqK

https://github.com/alysonla/dotfiles

2 Answers

Ryan Dudley
Ryan Dudley
Treehouse Project Reviewer

Hey Chris, hopefully I can be of some help.

While I have not ever used those dotfiles before I have broken my terminal once or twice myself, so hopefully this solution will work in your case as well.

It appears that dotfiles adds a line to both your .bashrc and .bash_profile files. My first suggestion would be to simply remove these added lines from each respective file. However when editing these files, be very careful not to remove anything that was not added by the modification as this could break your terminal even further.

Now, the .bashrc and .bash_profile files are located inside your home directory, and I believe are hidden by default. You can reveal hidden files by pressing Ctrl-H or View -> Show Hidden Files from the top menu (I'm on Fedora, so not entirely sure if its the same on Ubuntu, but it should be.) So in your .bashrc file (presumably at the bottom of it) look for . ~/bin/dotfiles/bashrc and remove that line, then save out the file. After doing this I would recommend reloading .bashrc, you can do this by logging out and back in or by typing ' . ~/.bashrc ' (without the quotes) into your terminal.

At this point I would check and see if the terminal has returned to normal, or at least a usable state. If you like you could also remove the added ' . ~/.bashrc ' line from your *.bash_profile file as well (you can reload .bash_profile the same way you reloaded the above .bashrc file). Also if you like you can remove the src files from the dotfiles modification, which appear to be located in your home folder in a folder named bin/dotfiles.

Additionally I would recommend taking a look at Oh-My-Fish. It is also a shell modification, that is based off of the fish-shell framework. It has a simple one-liner to install it and comes packed with the same functionality as dotfiles, as well as much much more. It is also easy to uninstall, and comes with a built in package manager that allows you to install plugins, themes, update and more. It may not be for everyone, but work taking a look at!

Hopefully this was able to resolve your issue, if not feel free to post here again so we can further troubleshoot the issue.

Christopher Lebbano
Christopher Lebbano
15,338 Points

Thank you for your help, I seem to have it fixed now.

Christopher Lebbano
Christopher Lebbano
15,338 Points

Thanks for the reply, but is there some way I can just revert the changes without editing bashrc ? I have my bashrc file open now but it contains a lot of text and I don't recognize what might have been added by dotfiles and what is there by default.

Ryan Dudley
Ryan Dudley
Treehouse Project Reviewer

Well, you could try removing the source of the dotfiles modification. It appears to be in the folder you created named bin (bin/dotfiles) within your home folder. When you installed the modification, you added the line . ~/bin/dotfiles/bashrc to your .bashrc file. This line is telling it to run the .bashrc file located within the dotfiles src folder, so if that file no longer exists it might throw an error. So ideally, if you can find the line . ~/bin/dotfiles/bashrc in your bashrc file and remove it, it would be best so it is no longer trying to use the bashrc file located inside the dotfiles src folder. This is the only line that was added by the modification.

If you are worried about breaking something, you could always just make a backup of your current .bashrc file before you change anything in case something goes wrong, so you could just replace it with the backup.

EDIT: After surfing around the web a bit, you might also be able to try THIS and see if that is able to restore your bashrc file to normal.)