#(UPDATE NEED HELP FROM WINDOWS USER)issues getting existing code into a new github repo

191 messages · Page 1 of 1 (latest)

shy finchBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

obsidian glacier
#

did the 3 dots and remote add and picked the correct empty repo, but the commit button is greyed out and when i go to the repo on github there's no code inside

night vine
#

What three dots?

#

What editor are you using

#

Or are you using pure git cli

obsidian glacier
#

using VS Code is my editor, the 3 dots is a settings tab in the source control tab in VS Code

night vine
#

Screenshot

obsidian glacier
#

clicked add remote, hit enter, it popped a list of repos, i picked the one

night vine
#

Screenshot the bottom left of the screen

obsidian glacier
#

?

#

did that get whatever ya needed

night vine
#

So it’s already connected to the github repo

#

Make some dummy change

obsidian glacier
#

in the code?

#

okay

night vine
#

Then git commit -a -m "test"

#

Yes

obsidian glacier
night vine
#

Yes

#

Now take the screenshot of the source control column

#

In vscode

obsidian glacier
#

shall i hit it?

night vine
#

Yes looking good

#

Hit it

#

Does it show up as success or failure?

obsidian glacier
night vine
#

If no dialogs show up then it is a success

#

Oh ok

#

Go to terminal do

#

git remote -v

obsidian glacier
night vine
#

Oh no looks messy

#

Do this

#

First, go to the repo, delete it and make a new one

#

We start afresh

obsidian glacier
#

i kinda sorta understand how it got that way i just wish it hadnt lool. gonna do those steps now

night vine
#

When creating the repo, do not add any files

#

Use a completely blank repo

#

Uncheck any boxes that add readme or license

obsidian glacier
#

oh shit that might be it lets see

night vine
#

No that isn’t it, it’s just if you added those files in later on there may be git conflicts and I don’t want to explain that relatively advanced concept now

obsidian glacier
#

okay new repo made

#

sorry had another sentence but deleted it

night vine
#

Np now what does the repo page look like

obsidian glacier
night vine
#

Good, nice

#

Now in local

#

Delete the .git folder

obsidian glacier
#

local meaning?

night vine
#

Your computer

#

Use file explorer

#

Go to the local folder

obsidian glacier
#

oh like the source ofGit

night vine
#

Find the .git folder

#

Likely it is hidden, unhide it

#

Then delete it

obsidian glacier
#

or will it literally be .git

night vine
#

Literally .git

#

No not this one

#

The working directory where you want to upload code to github

obsidian glacier
#

how do i find it if it's hidden?

night vine
#

Take a screenshot

obsidian glacier
night vine
#

If you want to upload d:\a\b\c to github

obsidian glacier
#

im sorry

night vine
#

Then use file explorer to go to d:\a\b\c

#

The folder you used vscode to open

obsidian glacier
#

oh

#

so delete .git

night vine
#

Are you there yet

obsidian glacier
#

ye

night vine
#

Take screenshot

obsidian glacier
night vine
#

So you want to upload this bobingus folder content right

obsidian glacier
#

yes

night vine
#

Yes then remove that .git

#

Then go to vscode and refresh it

obsidian glacier
#

i need admin rights?

night vine
#

Then take screenshot of vscode source control tab

obsidian glacier
#

its my fucking computer

night vine
obsidian glacier
#

rip me

#

we were so close

night vine
#

Google how to get admin right or whatever, I don’t use windows idk

obsidian glacier
#

okay i will

#

okay yeah i guess im stuck here for a bit

obsidian glacier
#

(UPDATE NEED HELP FROM WINDOWS USER)issues getting existing code into a new github repo

obsidian glacier
#

bump

midnight trench
obsidian glacier
#

theres 2 on the machine but when i go into the security settings it says my account has permissions for it

obsidian glacier
#

Update: I was able to delete the folder

night vine
#

only took five days 😭

#

now i assume you have a blank github repo

#

and a non-git project right?

obsidian glacier
#

im gonna log into github and confrim theres a blank repo

night vine
obsidian glacier
night vine
obsidian glacier
#

perfect thats what mine looks like

night vine
#

now go to the terminal in that project folder

#

vscode terminal should do that

#

and run git init

obsidian glacier
#

so now im golden?

#

just hit commit everytime i do an update?

night vine
obsidian glacier
#

okay i havent clicked anything after git init

night vine
#

yes, now type the commit message in that box

#

anything, "initial commit" for example

#

and hit commit

#

i think there will be a dialog box

#

dialog box or not, screenshot the result

obsidian glacier
night vine
#

nice, as i expected

#

click "Always" to never see this dialog again

obsidian glacier
#

epic

night vine
#

now what does the source control tab look like

obsidian glacier
#

now theres a publish branch button in src ctrl

night vine
#

nice

#

now go back to the repo on github

#

you should see a bunch of commands

#

check the "…or push an existing repository from the command line" section

#

you'll see something like git remote add origin https://github.com/joulev/blank.git

#

copy that command and paste in the terminal

obsidian glacier
#

alrighty done

night vine
#

what does the source control tab look like now

#

and what is the branch name at the bottom left

#

i think branch name should be main already right

obsidian glacier
#

branch is master, src ctrl still just has the publish branch button

night vine
#

and paste and run it in the terminal

#

the branch name becomes main right?

obsidian glacier
#

yes

night vine
#

nice

#

now copy the next command in that section

#

should be git push -u origin main

#

run it

#

what does the terminal output look like

obsidian glacier
night vine
#

good, now go to the github repo, and refresh the page

#

do you see your code there

#

you should see the code there

obsidian glacier
#

yes

night vine
#

good

obsidian glacier
#

theres a red x tho

night vine
#

the set up is done

obsidian glacier
night vine
#

next make a dummy change in the code

night vine
night vine
obsidian glacier
#

okay change made

night vine
#

now go to the source control tab, make a random commit message, then click commit

#

then screenshot the bottom left corner of vscode

obsidian glacier
#

should i hit sync changes too

night vine
#

screenshot

obsidian glacier
night vine
#

good, now click on that 0 v 1 ^

obsidian glacier
night vine
#

or the sync change button

#

both of them work the same way

#

ok nice, i see your commit on github now

obsidian glacier
#

okay it did a load animation and then the numbers disappeared

night vine
#

so that's the git 101 course on how to set up a project and push to github

night vine
obsidian glacier
#

thank you

#

now i just gotta remember how to make the repo link to a domain lol

night vine
#

to commit after setup, just commit in the source control, then hit the sync change

#

now the red X is because github couldn't deploy your app to github pages

obsidian glacier
#

uh oh

night vine
#

i don't use github pages so idk, can't help here

#

but you should probably just deploy to vercel instead

#

or netlify

#

or any services that deploy a vite project well

obsidian glacier
#

is vercel free and does it require learning new stuff

night vine
#

vercel is free and its UI is quite intuitive

#

i don't think it needs learning

#

log in with your github, then make a new project

#

then it will i think just work

obsidian glacier
#

sweet

night vine