GitHub - Getting Started with Repository

Hi,
I just created a new repository in GitHub. The screen looks as follows:

GitHub Repository Screen
I need to add a Python file on my hard drive. Call it C:\MyPython\Test\Steve.PY
but don't see how to do so.

From what I remember from Git (not GitHub) at my last position, a repository points to a particular directory on my hard drive, from which point, I can access its subdirectories. Accordingly, if my repository contains three files (A.PY, B.PY, C.PY) I will see them on my screen.

Accordingly, how can I get started with something similar using GitHub?

Thanks,
Steve
LVL 4
Stephen KairysTechnical Writer - ConsultantAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Raheman M. AbdulSenior Infrastructure Support Analyst & Systems DeveloperCommented:
To upload existing files to github repository you have to follow the following steps:
1. Create a repository in Github (you already have done)
2.  Clone the repository locally on your Computer. (reder: https://help.github.com/articles/cloning-a-repository/)
3. Move the file(s) to local directory (local repository you created above)
4. From command prompt, browse to local repository directory
Then Type:
git add .
git commit -m "First commit done"
git push origin master

Open in new window


Refer for more details: https://help.github.com/articles/adding-a-file-to-a-repository-from-the-command-line/

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Stephen KairysTechnical Writer - ConsultantAuthor Commented:
Hi Raheman,

I clicked on the first link. The first two instructions read:

Instructions Snippet
Per #2, I do not see the symbol to which it refers.
 (i.e. "click ____ to copy...")

Please advise. Thanks!
Steve
Raheman M. AbdulSenior Infrastructure Support Analyst & Systems DeveloperCommented:
Can you see button clone below the URL?
or you can select the URL and Ctrl+C as normal.
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Stephen KairysTechnical Writer - ConsultantAuthor Commented:
OK, got it. The first icon to the right of the URL?? I highlighted it below.

Create Repo Icons
Thanks.
Stephen KairysTechnical Writer - ConsultantAuthor Commented:
OK, I  must have missed a step somwhere. When I try the GIT command...

C:\Software Development\Python Code>git clone https://github.com/steve2916/Python-Projects.git
'git' is not recognized as an internal or external command,
operable program or batch file.

C:\Software Development\Python Code>

Open in new window


What do I need to add to my path? Or is it something else?

Thanks,
Steve
Raheman M. AbdulSenior Infrastructure Support Analyst & Systems DeveloperCommented:
You need to download git from github website and install
Stephen KairysTechnical Writer - ConsultantAuthor Commented:
OK, will try later or over the weekend. Thanks.
Stephen KairysTechnical Writer - ConsultantAuthor Commented:
Software installed. But when I try the commands, I get:

C:\Software Development\Python Code\Python-Projects [master +1 ~0 -0 !]> git add .
C:\Software Development\Python Code\Python-Projects [master +1 ~0 -0]> git commit -m "Steve's 1st commit"

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'stephen@SteveFireIsland.(none)')
C:\Software Development\Python Code\Python-Projects [master +1 ~0 -0]>

Open in new window


Thanks!
Raheman M. AbdulSenior Infrastructure Support Analyst & Systems DeveloperCommented:
Yes, after you install git,  you have to setup your identity so you type as suggested.
git config --global user.email  "StephenKairys@yahoo.com"   

Open in new window

change your email above with your email address. where --global indicates this identity use for all the repositories you will update from now on to your remote repositories.

(more details refer: https://help.github.com/articles/setting-your-email-in-git/)
Stephen KairysTechnical Writer - ConsultantAuthor Commented:
OK. That suggestion worked per the identity issue. But now...

C:\Software Development\Python Code\Python-Projects [master +1 ~0 -0]> git commit -m "Steve's 1st commit"
[master 215c4a9] Steve's 1st commit
 1 file changed, 3 insertions(+)
 create mode 100644 TestGit.PY
C:\Software Development\Python Code\Python-Projects [master]>

Open in new window


However, I did not see TESTGIT.PY in repository until I pushed. That's expected behavior, right?

Thanks!
Stephen KairysTechnical Writer - ConsultantAuthor Commented:
Next question.  When I used Git at a previous job, I worked from the GUI, which looked something like the below.

(NOTE: I have obtained these screenshots from various info found online. )

Git GUI
You had a list of files (e.g. TESTGIT.PY) in the upper left corner. As I recall, as soon as I made a change to a file in my repository, it would appear there. I guess the metric must be that any file on my hard drive (in the directory per my repository) with a delta vs. the repository would appear.

The lower left would be the file(s) that I staged to be included in a commit.

You also had a list of commits (panel on the top right which is empty on this example).  A COMMIT could include one, or many files. As I recall, info about the commit would display here e.g.

Git GUI Commit Examples
Accordingly, is there a way to make GitHub do the same thing? That is:
- Display the files with deltas.
- Allow me to selectively put such files in a staging area.
- Commit (and if needed push) and have the commit info displayed on the same screen.

I hope the above is not too confusing. :)  Please let me know if I need to clarify. Thanks!

Steve
DrTribosCommented:
Steve - I think SourceTree might be a good solution for you...   https://www.atlassian.com/software/sourcetree/overview/

I'm new to the world of Version Control but found this easy to use, there seems to be a lot of community support, works with Git & Mercurial and makes setting up repositories easy - not necessarily intuitive but easy once you know how...

I'm using it with BitBucket (bitbucket.org), and as far as I can tell the 2 work really well together.
Stephen KairysTechnical Writer - ConsultantAuthor Commented:
Thanks.
Stephen KairysTechnical Writer - ConsultantAuthor Commented:
Hey all,
I am going to file a request for attention. This project (for which I needed GITHUB) never took off, and I no longer need to use it. At least for now.

Is there a way that someone more knoweldgeable than myself about GITHUB can evaluate the proposed sol'ns, and suggest which one should be Accepted?

Thanks!
Steve
Stephen KairysTechnical Writer - ConsultantAuthor Commented:
OK, looks like I cannot file a Request for Attention. Any suggestions on how to proceed? Thanks!
DrTribosCommented:
Honestly Steve I object, this seems to happen a bit with your questions. You have 2 very valid directions but can't be bothered to "re-educate" yourself... do you honestly expect people to keep trying to help you?
Stephen KairysTechnical Writer - ConsultantAuthor Commented:
All,
I stand corrected by DrTribos. You are entirely correct. You guys work hard w/o being paid/on your own time, and I owe you all the courtesy of more timely close-outs of questions.

Mr. Wolfe - our friendly Mod - has helped me identify two reasonable solutions to tag.

Thanks for all your efforts.
Steve
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Version Control

From novice to tech pro — start learning today.