Go to Post However, mentoring isn't for you. It's for the others. - Alan Anderson [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 05-08-2012, 12:52
F22Rapture's Avatar
F22Rapture F22Rapture is offline
College Student, Mentor
AKA: Daniel A
FRC #3737 (4H Rotoraptors)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Goldsboro, NC
Posts: 476
F22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant future
How to setup version control on Github?

I'm new to programming and while I've played around with the Github for Windows client and Netbeans and such, I haven't managed to figure out how to push my current code to Github, and don't really know where to go from there once I do. Any tips?
  #2   Spotlight this post!  
Unread 06-08-2012, 13:56
tech2077 tech2077 is offline
Registered User
AKA: Matthew Skolaut
FRC #3847 (Spectrum 3847)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Houston
Posts: 21
tech2077 is an unknown quantity at this point
Re: How to setup version control on Github?

For a good tutorial on most of the features of git specific to github, try try.github.com. It only covers the command line side, but it's helpful in better understanding git. When committing with Github for Windows, it's as simple as commit and sync. As for netbeans, it's as simple as putting in your git url and github login information into the team menu settings.
  #3   Spotlight this post!  
Unread 06-08-2012, 17:34
kenavt's Avatar
kenavt kenavt is offline
Registered User
AKA: Colin S
no team
Team Role: Alumni
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Ann Arbor
Posts: 253
kenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond repute
Re: How to setup version control on Github?

When 2337 looked into GitHub, I was recommended Pro Git by Scott Chacon (which is free), and was tremendously useful. I found the GitHub help to be useful when dealing with GitHub, but not with Git itself, the version control system.

As well, the GitHub for Windows client is very poor and not well-written. Frankly, my first ever experience with bash scripts (command-line) was with Git, and it was eye-opening. I highly recommend using Git bash.
__________________
University of Michigan Computer Engineering '17

FRC 2337 student alumni (2010-2013)
  #4   Spotlight this post!  
Unread 11-08-2012, 22:45
F22Rapture's Avatar
F22Rapture F22Rapture is offline
College Student, Mentor
AKA: Daniel A
FRC #3737 (4H Rotoraptors)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Goldsboro, NC
Posts: 476
F22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant future
Re: How to setup version control on Github?

I have the repo set up between GitHub and Netbeans but it's currently empty - how do I move my existing code to it?
  #5   Spotlight this post!  
Unread 15-08-2012, 23:17
F22Rapture's Avatar
F22Rapture F22Rapture is offline
College Student, Mentor
AKA: Daniel A
FRC #3737 (4H Rotoraptors)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Goldsboro, NC
Posts: 476
F22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant future
Re: How to setup version control on Github?

WHOOO! Finally figured it out after some google-fu

For others' reference, here are the steps I took:

Create your new repo on Github, take note of the https:// address in the edit bar (not url bar)
Install Git Bash from the Git website http://git-scm.com/downloads/
Open Git Bash
Type the following:

(Replacing "Username" with your Username, and "directory" with your directory.)

Code:
cd /c/Users/Username/directory-of-project/
Should now show a yellow highlighted directory preceded by a tilde (~)

Code:
pwd
Verifies that the current directory is the one typed above

Code:
git init

git add .
If it pops up an error message "LF will be replaced by... ", type the following: (If not, continue)

Code:
git config user.email "Your email address"

git config user.name "Your name"

git add .
Continuing...

Code:
git commit -m 'initial commit message'

git remote add origin https://github.com/YourAccountName/Project.git
That last address is the one I mentioned to take note of earlier

Code:
git push origin master
At this point it will give you a login prompt for github. When you type the username and password the characters will be invisible, but they're there. It confused me at first.

It may give you an error. If not, great, if so, type

Code:
git pull origin master
and then when that succeeds,

Code:
git push origin master
And now you should be done. Refresh your github repository page and the code should be there.

Last edited by F22Rapture : 15-08-2012 at 23:27.
  #6   Spotlight this post!  
Unread 16-08-2012, 12:13
Ginto8's Avatar
Ginto8 Ginto8 is offline
Programming Lead
AKA: Joe Doyle
FRC #2729 (Storm)
Team Role: Programmer
 
Join Date: Oct 2010
Rookie Year: 2010
Location: Marlton, NJ
Posts: 174
Ginto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of light
Re: How to setup version control on Github?

This looks like a great step-by-step method for teams that want to set up GitHub! I just noticed two small things:
  • The "LF will be replaced by..." message is not an error. Because Windows and *nix (UNIX-like systems such as mac and linux) store line endings differently (Windows uses a sequence two characters, CR and LF, or "carriage return" and "line feed", while *nix systems only use LF), git has a feature that automatically converts between the two, so that the repository's contents are always consistent, even if people have committed from different OS's.
    The answer to this StackOverflow question can make things a bit clearer.
  • Not really a problem, but characters not appearing as you type a password is pretty standard behavior in bash. Although it can be unnerving, it's actually slightly more secure, because people looking over your shoulder can't even tell how long the password is, much less what the characters are.
  #7   Spotlight this post!  
Unread 16-08-2012, 15:11
Zach O's Avatar
Zach O Zach O is offline
Building an iOS app @ glacial speed
AKA: @FRCZach
no team
Team Role: Alumni
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Atlanta, GA
Posts: 512
Zach O has a reputation beyond reputeZach O has a reputation beyond reputeZach O has a reputation beyond reputeZach O has a reputation beyond reputeZach O has a reputation beyond reputeZach O has a reputation beyond reputeZach O has a reputation beyond reputeZach O has a reputation beyond reputeZach O has a reputation beyond reputeZach O has a reputation beyond reputeZach O has a reputation beyond repute
Re: How to setup version control on Github?

GitHub has some great articles on setting up your environment for using Git and GitHub (setting your GitHub username globally, etc) https://help.github.com/articles/set-up-git

They also go through the process listed above with Creating A Repository

Anything past that, I agree with Colin, go with Pro Git, or check out the Git documentation http://git-scm.com/documentation
__________________
Follow me twitter dot com slash frc zach
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 01:39.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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