How to upload a folder on github?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Syl

Greets!

I tried to find tuts and made some searches, but I can’t get the right steps…
Got a gihub account, git bash installed, but how to mix the two for importing my folders please?

I’m not suggesting that this is better than using the command line, but I’ve been using Git Kraken which is a gui front end to git. It is a really friendly to use software that has made me feel comfortable and confident enough to fully embrace git. It makes things like branching, merging and working with remote repositories a breeze

zdimaria | 2018-04-11 18:49

Hey! Thxs a lot, that’s good tip! :slight_smile:

Syl | 2018-04-11 19:03

:bust_in_silhouette: Reply From: Zylann

Do you know how to use Git? (Note that Github is not a file hosting service, it’s a version control hosting service).
I don’t understand what you mean by “how to mix the two for importing my folders”.

Normally, once you created a repo on Github, the website gives you which commands to run from your local repro in order to setup the remote (the one you made on Github) and upload your project.

Given the fact I assume you already have a project, you can use git init from Git bash inside your project folder. This will initialize your local repo, unless you did it already.

Next, for Godot 3 projects it is recommended to create a .gitignore file (exactly that name, starting with a dot) that lists all files Git should ignore, especially the .import folder because those files are generated.
In git bash, type touch .gitignore and put this in the file using a text editor:

 .import/

Then, you will have to tell Git where is your remote repo (use the URL Github gives you!), and give it a name, usually we use “origin”:

git remote add origin https://github.com/your_username/name_of_your_repo.git

Now you may want to do your first commit, to add all files to version control.
Select files to commit (* means all changes):

git add *

Commit them with a message:

git commit -m "First commit to add project"

Then, optionally, upload all commits you made so far to the remote repo (Github)

git push origin master

You may be asked for Github credentials to authenticate your upload.

Warning:
Note that if your project is huge (gigabytes, as I saw last time), that may take a lot of time. Versionning huge files will make the size of your repro grow considerably, because Git will have to remember all changes you ever made to the assets.
People have various way of dealing with this: not doing anything, making the project lighter, putting assets in a non-versionned folder or using Git LFS are some options.

Also, if this is not a question about uploading folders using a Godot script, then going further in Git explanations is a bit offtopic to this website.
The info I gave above is veeery basic. For more in-depth information about Git, consider looking somewhere else such as https://help.github.com/, Git - Book or Newest 'git' Questions - Stack Overflow.

Thanks so much for your reply, and yes, it’s to upload my godot project. But I can’t even start the ‘git init’, as I have a ‘permission denied’ on bash…

Syl | 2018-04-10 15:02

You have to open git Bash in the folder of your project before using git init (i.e the working directory of the console must be there).
If that’s the case, then I don’t know what’s going on… maybe that folder is special, has some system restrictions or so

Zylann | 2018-04-10 18:58

Ok, thxs to you I’m learning my way in git docs. Cheers!

Syl | 2018-04-11 12:15