This is a short guide to set up and publish to a new repository on GitHub.
This is a short guide that will help you setting up and publishing to a new repository on GitHub.
I personally didn’t find it trivial and some steps seem unnecessary, but, in my case, they were all required in order to avoid all kind of errors.
Please read every instruction (every step) carefully until its end before trying it to know what to expect.
- Create local folder (on your computer) with your files
- LogIn github site, press + on the upper right side of the screen and chose “new repository”
- Pick name, description and don’t pick the option to create README. Press “Create repository”
- On the next screen, the important part is the link to your repository, in this case:
Save this link for later (step 9)
- Return to VS Code. Chose “View” in the menu and pick “integrated terminal”
- you will be given a command line, you have to be in the folder you created, if not, move to it typing “cd..” to move one folder up and “cd folderName” (replace folderName with your folder’s name) to enter it.
In my case the command line showed
“C:\some local folder\freecodecamp\challenges\no repeats please>”
and I had the needed folder in freecodecamp>instructions vscode github
So I have to do “cd..” twice to get to freecodecamp folder then “cd instructions vscode github” to enter my foder. Now the command line looks like this:
C:\some local folder\freecodecamp\instructions vscode github>
- Write: “git init” and press “return”
- Enter command: “git add –all”
- Enter command “git remote add origin https://github.com/Nei-V/instructions-vs-code-github.git”
(Replace with the link to your repository from step 4)
- Enter command:
git commit -m “Instructions”
Replace Instructions with the description message of you commit.
- Enter command: “git push -u origin master”
It will give an error and it will ask for username (that is your username on github, for example your email). press Enter. It will ask you for your password for github. write it and press Enter again.
That’s it. If everything worked you will see a long message ending with “Branch ‘master’ set up to track remote branch ‘master’ from ‘origin’.”
Congratulations, you have your first files in your respository.
You can find these instructions in my GitHub here: