— GIT TUTORIAL —
For questions and help just tag me in the comment section
STEP 1: CREATE A “.gitignore” file and PASTE THE FOLLOWING
( ADJUST ACCORDINGLY! )
*.zip
node_modules*
*.txt
.*
*.npmignore
env*
test.mjs
t.js
tempDist
tempPublic
output
domains.json
*.nix
test*
test2*
nodemodules*
package-lock*
*.temp
( DON’T PASTE THIS NOTE,
ADD MORE ACCORDING TO THE FILES YOU WANT TO EXCLUDE AND REMOVE ANY FROM THIS IF A CRITICAL FILE IS NOT ADDED TO YOUR REPO )
-------- NEXT STEPS --------
step 1: git init
step 2: Paste this code, to “.git/config”
( ADJUST ACCORDINGLY FIRST! )
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = https://github.com/GITHUB_USERNAME/GITHUB_REPO.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
[user]
name = GITHUB_USERNAME
email = YOUR_EMAIL_ADDRESS
[branch "main"]
remote = origin
merge = refs/heads/main
------- NEXT -------
step 3: git remote add origin https://github.com/GITHUB_USERNAME/GITHUB_REPO.git
step 4: git remote -v
( your link should appear as shown in the video. )
step 5: git branch
OPTION 1: if no branches appear, do the following
git fetch origin main
OPTION 2: IF IT STILL DOESN’T APPEAR DO THIS COMMAND
git branch -M main
OPTION 3: STILL NOT SHOWING?
git pull origin main
OPTION 4: STILL?
git remote update
OPTION 5: TRY THIS LAST
git switch main
( IF STILL NOT WORKING TAG ME IN THE COMMENTS AND COMMENT THE SCREENSHOT, OR DM ME )
----- next is Github CLI authentication -----
step 6: gh
– chances are you don’t have the gh CLI installed,
so it will prompt you to install it via NixOS,
enter Y –
wait for it to finish installing and reloading the nix shell.
Now.
step 7: gh auth login
DO THE FF AS SHOW IN THE VIDEO…
[ENTER]
[ENTER]
TYPE Y
[PRESS ARROW DOWN TO SELECT PASTE AUTHENTICATION TOKEN]
PASTE YOUR AUTHENTICATION TOKEN GENERATED FROM THE BEGINNING…
( DON’T SHARE THIS WITH ANYONE !! )
next step
step 8: gh auth setup-git
---------- DONE ----------
- Next Step —>
step 9: git add .
step 10: git commit -m "ENTER YOUR COMMIT MESSAGE HERE"
step 11: git push -u origin main
wait for it to finish and,
you should see your files transferred to your Github repo…
AGAIN, FOR HELP JUST TAG ME IN THE COMMENTS…
Save your repls now to avoid future trouble…