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

General Discussion

Problems uploading to github

Hi,

When I upload a file to Github I keep getting what looks like, to me spam in my folder and not my files. They are called .gitattributes & gitignore files. Does anyone know what is happening here?

2 Answers

Those files are added by Git. gitattributes allow you to specify certain paths. I don't ever use that file, to be honest, that's some next level stuff, but you can read about here: https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes

gitignore I do use almost every project, and if you add files/folders into this document, git will, ignore them. This is good for files that contain sensitive info like API keys, usernames, or passwords, as you certainly wouldn't want to check in files with sensitive data to a public git repo. It's also helpful for when you are using other people's plugins. You wouldn't want to check in other code already under another versioning system, and you wouldn't want to check in auto generated files.

For instance I often make sure that the entire node_modules folder is in gitignore, since everything in there is already controlled by node package manager. In a ruby project, I also add the gem_lock file since that is auto generated when you run a command to bundle all of the gems.

Hope that helps.

Hi,

Thank you. My projects are simple at the moment. When I add it as a new repository my files pop up for a second and then flashes out and it is then replaced with the git ones. I do not know how to get mine to show again, so that I can move forward and publish them. Any ideas on what is going on?

I am trying to upload via the desktop version and have somehow managed to do it before, after continuous re entering the file. I have just been in via the main web page also and no luck. The Treehouse video does not show the git files getting in the way. If anyone has had a similar issue and can help me out or know another way to upload files, rather than via desktop. It would be appreciated.

I have managed to solve the problem. If anyone else is not managing to get past the git applications after uploading your repository on a PC using the desktop app, look at the 3 circles under the publish button and click on the last one. It will take you to your repository so you can finish uploading your file.

Glad you got it figured out..yay!