How to avoid uploading the build folder when using Github

My tean wants to upload our program project on Github. And l think we shouldn’t upload the /build folder. But when l init the whole folder with git. It seems that it is impossible to avoid uploading the /build folder every time l want to make a commit. Is there any solution to this?

1 Like

Using a .gitignore should be work for this. The documentation is quite useful

1 Like

Thanks. Which folder aren’t necessary to be uploaded?

Edit: Is there any solution to generate this file automatically?

When you created the robot project with vscode, it should have included a .gitignore file.

If you accidentally deleted it, you can find it here.

Thanks , l have copied it to my .gitignore. But every time l build my code , it still has some files which can also be uploaded.

.gradle is listed in the .gitignore file, so that folder should be ignored … from now on. But if you originally committed files in that folder to github, before you listed .gradle in .gitignore, they’re tracked until you manually remove them from git.

1 Like

Thanks ,l have created a new project and replace it with my own /src and it now works perfectly.

I’d recommend reading up on the proper way to use git add and git remove in commits. Can help alleviate stuff like this quickly.

I recommend making sure you commit the .gitignore file to the repo. So that any future clones of the repo will include it.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.