GitHub - Getting Started with Repository

Stephen Kairys
Stephen Kairys used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Messaging and Directory Services
Commented:
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/
Stephen KairysTechnical Writer - Consultant

Author

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. AbdulMessaging and Directory Services

Commented:
Can you see button clone below the URL?
or you can select the URL and Ctrl+C as normal.
Introduction to Web Design

Develop a strong foundation and understanding of web design by learning HTML, CSS, and additional tools to help you develop your own website.

Stephen KairysTechnical Writer - Consultant

Author

Commented:
OK, got it. The first icon to the right of the URL?? I highlighted it below.

Create Repo Icons
Thanks.
Stephen KairysTechnical Writer - Consultant

Author

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. AbdulMessaging and Directory Services

Commented:
You need to download git from github website and install
Stephen KairysTechnical Writer - Consultant

Author

Commented:
OK, will try later or over the weekend. Thanks.
Stephen KairysTechnical Writer - Consultant

Author

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. AbdulMessaging and Directory Services

Commented:
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 - Consultant

Author

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 - Consultant

Author

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
Commented:
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 - Consultant

Author

Commented:
Thanks.
Stephen KairysTechnical Writer - Consultant

Author

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 - Consultant

Author

Commented:
OK, looks like I cannot file a Request for Attention. Any suggestions on how to proceed? Thanks!

Commented:
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 - Consultant

Author

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

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial