Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Need assistance uploading code to Github. (http://www.chiefdelphi.com/forums/showthread.php?t=138223)

thatprogrammer 20-09-2015 17:37

Need assistance uploading code to Github.
 
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

Re: Need assistance uploading code to Github.
 
https://git-scm.com/book/en/v1/Getting-Started

Start there

ShortCircuit908 22-09-2015 01:10

Re: Need assistance uploading code to Github.
 
Simple guide using Git bash:
  1. Navigate to your workspace using the 'cd' command
  2. Code:

    git init
    (Creates an empty repository)
  3. Code:

    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
  4. Code:

    git add -A
    (Adds current files to the repository)
  5. Code:

    git commit -am 'Initial commit'
    (Creates a commit with added files)
  6. Code:

    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.

joelg236 22-09-2015 14:05

Re: Need assistance uploading code to Github.
 
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

Re: Need assistance uploading code to Github.
 
Quote:

Originally Posted by joelg236 (Post 1496988)
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

Re: Need assistance uploading code to Github.
 
Quote:

Originally Posted by SamcFuchs (Post 1497402)
In terms of .gitignore, you can pretty much just use the /dist/ file. You don't really need anything else.

We use:
Code:

*~
/bin/
sysProps.xml
/build/
/dist/


SamcFuchs 27-09-2015 18:04

Re: Need assistance uploading code to Github.
 
Quote:

Originally Posted by Joe Ross (Post 1497405)
We use:
Code:

*~
/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-prac...ter/.gitignore

ShortCircuit908 28-09-2015 23:26

Re: Need assistance uploading code to Github.
 
Quote:

Originally Posted by SamcFuchs (Post 1497734)
Here's a .gitignore that I like. It leaves pretty much only the src.

https://github.com/team236/2016-prac...ter/.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.


All times are GMT -5. The time now is 10:22.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi