This does not include how to create an account on GitHub, and does not include how to install Git on your client. The local client examples are on a Windows 10 platform.
Create a repository on Github:
I prefer to use Git from a PowerShell session (rather than e.g. a Git for Bash session). The installation of Git will likely have added it to the path. See above.
From there I ran the command in the lime/pink box above (“git clone… “). That warned me as you see that I was cloning an empty repo. True.
I then followed the commands in the example above (git init, git add…, git commit…, git remote add., git push…).
Going back to the GitHub website showed me the README.md was now there.
Next, I added a new, empty file in the root of ExampleRepository:
New-Item -Path ./testfile.txt -ItemType File
To make git aware of this and any other files in the repo, I ran (note the dot):
git add .
No feedback on the command line, but when I commit…
Now push the committed file or files up to the remote server:
To bring back down anything that might have changed on the remote server:
If things change locally, and that needs committing and pushing…
I have a 32-bit tablet… and Github Desktop just doesn’t run on there. So I had a reason to use the command line git.
I had an existing repository, to which I wanted to add folders and files. So in summary, the actions were:
- clone the repo to a local folder [git clone [https:// etc (get it from github.com/user)
- add the files and folder [git add [example folder root]]
- commit that new stuff and any changes [git commit *]
- note this opens notepad – put a comment, save and exit
- push the files up to github [git push]
And it was honestly that simple