Log in

View Full Version : Need assistance uploading code to Github.


thatprogrammer
20-09-2015, 17:37
Hey,
I've been trying to upload my code to a github repo, so I can work on it from school. Despite getting some help from another team through CD, I am still confused how to do this. I can figure out how to upload my code to a .git file on my pc, but I have no idea how to upload that to the repo on the github website.
If any additional info is needed for you to help, please ask!
Thanks!

joelg236
20-09-2015, 21:15
https://git-scm.com/book/en/v1/Getting-Started

Start there

ShortCircuit908
22-09-2015, 01:10
Simple guide using Git bash:

Navigate to your workspace using the 'cd' command
git init (Creates an empty repository)
git remote add origin <SSH clone URL> (Adds the remote repository as 'origin.' <SSH clone URL> is the URL given to you by GitHub, resembilng git@github.com:Username/RepositoryName.git
git add -A (Adds current files to the repository)
git commit -am 'Initial commit' (Creates a commit with added files)
git push origin master (Pushes local commits to the remote repository)


It is recommended that you have a decent .gitignore file in the root directory of your workspace, in order to keep unnecessary files out of the repository. A good example of a .gitignore file can be found here (https://gist.github.com/Short-Circuit/a698727a6db82517465c).

joelg236
22-09-2015, 14:05
Please take the time to actually understand git before using it with other people. Don't just copy paste commands from guides online.

thatprogrammer
23-09-2015, 11:42
Please take the time to actually understand git before using it with other people. Don't just copy paste commands from guides online.
I am currently reading your guide to learn how to properly use Git, thanks!
Sorry if it appears like I'm in a rush, this code does need to be uploaded fast. (Currently going to upload the code, and then work on properly learning git)
EDIT: Managed to post the code to our repo! I'm continuing to learn git as I go on, but at least I can work on robot code from anywhere now :)

SamcFuchs
24-09-2015, 21:02
In terms of .gitignore, you can pretty much just use the /dist/ file. You don't really need anything else.

Joe Ross
24-09-2015, 21:16
In terms of .gitignore, you can pretty much just use the /dist/ file. You don't really need anything else.

We use: *~
/bin/
sysProps.xml
/build/
/dist/

SamcFuchs
27-09-2015, 18:04
We use: *~
/bin/
sysProps.xml
/build/
/dist/

Yeah, looking back, I didn't think that reply through. Here's a .gitignore that I like. It leaves pretty much only the src.

https://github.com/team236/2016-practice/blob/master/.gitignore

ShortCircuit908
28-09-2015, 23:26
Here's a .gitignore that I like. It leaves pretty much only the src.

https://github.com/team236/2016-practice/blob/master/.gitignore

You shouldn't need to ignore .xml files. In fact, you shouldn't, especially if your project uses a framework such as Maven, which is based off xml files, or if your project uses an XML properties file.