I have github set up (I think). I have a terminal window with the local repository folder active. I executed the git remote add pathname command and now have this:
I think I’m ready to push my files to github for public use, but I’m stuck and can’t find the kind of simple instructions I can understand to make the push happen.
To prove my ignorance: It’s my understanding that I first have to add the files, then ‘commit’ them, then push the ‘commit’ to my public github repository. If that’s wrong, I may need more help than I know.
Is there a way I can tell if my local git repository is setup and what it contains? I tried git ls-files and got nothing.
OK, I made some progress. I entered the git add pathname sequence then did a git ls-files and got these results, so I think my local repository is set up:
I need simple instructions without having to learn the intricacies of how git and github work. Every page I’ve found so far is ‘cluttered’ with that information but doesn’t give the kind of explicit instructions I need to proceed from where I am now.
I entered git at the command line to get the following screen that tells me all the operands and a little explanation, but I don’t know enough to choose among them.
Here is how my local repository is setup:
G:\HutchinsClanProject top directory contains subdirectories (\Images\Scripts\Styles\Thumbnails) and my HTML file (newHTML.html).
The Styles subdirectory contains the CSS files that contain styling code. The Images subdirectory contains .jpg and .png files that I want to display. Eventually the Scripts subdirectory will contain javascript files but the subdirectory is empty as is the Thumbnails subdirectory.
FWIW, I plan to put images and icons in the Thumbnails subdirectory that when displayed will be clickable to link to other pages.
Can someone suggest what git commands I need to use and what files to add/commit/push from this directory structure, or point me to a simple page that addresses this without all the Git and other Github information?
OK. Maybe the foregoing questions are moot. Here’s the current info from my command terminal:
It appears that I successfully created a local repo, added my project files to it, and committed it to a remote repo . . . if the the commit and push worked, but I don’t know how to check to be sure they did. I think I have a remote repo set up. If I do, it should be public which should mean that anyone can access my code.
Can you, or someone, please, tell me how to check the contents of the remote repo (as in see the files that I put there)? Can someone please try to access my repo, take a ss and post it in this thread to prove that it’s set up?
If I have this set up, this project will be a good pony to ride to learn more about git and github as I continue to develop my website.
Thanks for your patience. If I knew how to strike through the information in my op that is now moot, I’d do so. I think leaving it in this form - with strikethroughs - might help someone coming here like me trying to get past his questions.
I don’t know the link to the remote repo. Is there some way I can find out what it is? I did this yesterday and have slept once which for an 82yo does weird things to memory.
If it helps, I still have my terminal window open. Can I find that remote repo link there?
If it helps, here is a ss of the git init command I used.
So, does that mean that the url that links to my remote repo is “G:\HutchinsClanProject”? If that’s right, how is that information entered by someone like you so that you can see my repo? Do you have to enter that as a fetch from github using the terminal?
the remote repo doesn’t appear magically, you need to create it in something like github, gitlab, codeberg… which are sites where you can create a repo and connect to your local repository
Have you looked at all the ss of my terminal, especially that last one? If so, are you saying that I did not create a remote repo? If so, what does the result of the git remote show origin in that ss mean?
Yes, I see that you put the local repo as remote repo. You do not have real remote repo. You would need to create the repo on a service like GitHub, like I already said, and link that as remote repo.
For your local git repo to be linked with the remote github repo I would need to see something like this:
you need to first create a repo on github, after that you can link the local repo to the repo on github
the link to use when adding a remote will be https://github.com/<username>/<repo_name>.git where <username> is your username on github and <repo_name> the name you give to the repo when you create it