How do I upload to GitHub?

Started by Christoffre, April 18, 2016, 02:30:18 PM

Previous topic - Next topic

Christoffre

Hi

I want to contribute to the Swedish translation but I have no idea on how to use GitHub. I do already have access to the project as I sent a mail to Ludeon and "joined" the translators a year ago, but I gave up since I couldn't find any tutorials that explained how to use GitHub.

I get the sense that every tutorial available only explain how I start my own project, but not on how I upload and contribute to an existing one.

Can someone explain it to me like I was a five year old, or send a link to a fitting tutorial?  :'(

Nemh

Actually, if you understood the basics git principles that should be quite easy. As you have direct access to the repo, the only step that could change between what you'd have to do and what a tutorial that explains how to start a project would ask you to do is the very first command.
While the tutorial's procedure will usually start by typing :
git init

You will have to start by typing :
git clone https://github.com/Ludeon/RimWorld-Swedish
(assuming that's the good repo url for the Swedish language ;) )

And then everything will work as described in every tutorial you may find (i.e. modifying local files, commiting, branching, etc, you just start with a non-empty project. You will still have to 'git push' your changes when they're supposed to go to the online github repo; as you have access to the repo, you'll just be invited to type your github username and prompt you password and that should be fine).

Yet I may try to answer any of your questions if you still have some !

Christoffre

Thanks for the help.
Hopefully I will not make any irreparable damage.  ;D

Christoffre

#3
Quote from: Nemh on April 18, 2016, 06:59:52 PM
Actually, if you understood the basics git principles that should be quite easy. As you have direct access to the repo...
... Yet I may try to answer any of your questions if you still have some !

I hope I don't make you regret you said that.   ;)

  • When I upload a translation to GitHub, should it be as a Pull request? I've basically fumbled around trying to understand GitHub.  ;D
  • If so, how long does it take before the Pull request becomes accepted? A couple of days? A month? Just before next patch?
  • The other Swedish translators haven't been active since 2014. Will this be a problem? Do they need to approve or accept anything?

Nemh

Don't worry ! :p

The 'pull request' thing is proper to GitHub, even thought there are equivalents in other git-based websites. This system is made to make possible the contribution of someone who doesn't have access to the repo, by allowing him to submit some of the modifications (i.e. some commits) he made on his fork (a distinct copy of the repo hosted on GitHub) to the team working on the main repo. The pull request may then be approved as soon as the said team approves it, it may be in a couple of hours, in a couple of days, or never if the team isn't active on GitHub... So in this case, as you're the only one currently active and with access to the repo, it makes somehow no sense to use the pull request system, as your pulls would then have to be reviewed by... you !  :P

As you have access to the repo, you don't have to use the pull request system because you have the 'power' to upload directly on the main repo : instead of using the fork button on the GitHub interface, and then working on your copy, you can just work on the main repo as if it was your, as you're on your own, the result will be the same here. ;)

Christoffre

Quote from: Nemh on April 23, 2016, 09:24:17 AM
Don't worry ! :p

The 'pull request' thing is proper to GitHub...
Ahh... It appear as I forked it by mistake.

How do I upload directly to Ludeon/RimWorld-Swedish? (This is the well referred repo?)
I have found an Upload-button on the Swedish project's GitHub-page, but it say:

Uploads are disabled.
File uploads require push access to this repository.


Is this normal or is something wrong?  :-\
An upload-button seems to be so much easier than entering commands in a command prompt.  ;D

If not, what is the command prompt command to upload via Git-bash/Git-cmd?

Nemh

Actually I have no idea on how to use GitHub without the command prompt... And I do doubt this would be easier without it anyway... ;D

But it's not that complicated to use a terminal, as you only need to 'remember' 4 or 5 commands for all the simple stuff.

The first thing you need to do is to have the remote repo cloned into your computer :
cd <the path where you want the repo to be stored on your computer>
git clone https://github.com/Ludeon/RimWorld-Swedish


That will allow you to work directly on the files : you can modify content or add files in the new directory created. Once you've done some modifications, you'll need to add the files you've modified / added to the index of files that will be commited :
git add <files name>
(You can easily see what have changed since the last commit using :
git status
That's easier to see what you need to add.)

Then you need to commit (i.e. validate your modifications) using
git commit -m "Message that summeriez what you are commiting"

You can repeat this process several time on your local repo, and when you want to send your modification to the remote repo, you'll have to use :
git pull
This command is to make sure that you're in sync with the remote stuff, that you won't overwrite anything (even if git will prevent you to overwrite things anyway... ^^), and then
git push
You'll be asked your GitHub credentials at this point, and after that, your modifications will be sent on the main online repo.

I think that's pretty everything you'll need to know to work on that, but I do recommand you read some basic tutorial on git (maybe search for 'git tutorial' instead of a 'github tutorial', GitHub is just a platform where git project are stored), just to make sure you understand more or less what happens with those basics commands. I don't think you'll need to go further than what I described before for such a translation project. ;)

Christoffre

Quote from: Nemh on April 23, 2016, 11:18:39 AM
Actually I have no idea on how to use GitHub without the command prompt... And I do doubt this would be easier without it anyway... ;D
...
Thanks!
This is the exact guide I have been looking for everywhere. I finally managed to upload my first files to GitHub.  ;D

dgdobrev

#8
Hello, guys!

I would like to update the Bulgarian translation to Rimworld. I have already uploaded all of the "free" xml files under the respected categories (main and keyed) in the existing BG repository, but I have trouble making a folder (or subcategory if you will) in definjected the way the German translation is made, for example. I have access to the repo and a user, but I do not see a way to add folders or create subcategories.

Well, as with many things in my life, I self-taught myself... You can do it in github as well - you need to simply add a directory by using the slash:
/name/
and then add the xml file that goes in. Simpler than expected...

WaKeMaTTa

If you use Windows or MacOSX you can use the this official tool https://desktop.github.com/