#πŸ”’ Visual Studio Code Binding With Github

304 messages Β· Page 1 of 1 (latest)

pliant shore
#

Hey Guys Help me !

noble birchBOT
#

@pliant shore

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

pliant shore
#

Hello anyone?

fading kindle
#

How can help you

pliant shore
#

i need some guide for binding vs code to github

#

i already insatlled git

fading kindle
#

Open vs code

pliant shore
#

ok

fading kindle
#

The terminal

pliant shore
#

ok

fading kindle
#

git --version

#

Paste this in terminal

pliant shore
#

git version 2.46.2.windows.1

#

win7

#

its the last supported version for window 7 os

fading kindle
#

It means you have installed git correctly, now VS Code Terminal:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"

pliant shore
#

my github username?

fading kindle
#

Your GitHub username is the name you chose when you created your GitHub account.
It’s the name that appears:
In the URL of your profile: https://github.com/**username**
In the top-right corner of GitHub when you’re logged in.

#

Did you used chatgpt

pliant shore
#

πŸ˜…

fading kindle
pliant shore
#

he ended up giving me commands that deletd my whole fileesss

fading kindle
#

I have given commands to you for checking up version, lemme ping any engineer 😁

pliant shore
#

ok

fading kindle
#

@high cipher

pliant shore
#

i am so confused i want to collaborate with someone at night , but so frustrated

high cipher
#

hey

#

what's wrong

pliant shore
#

can you see our whole chats its frustrating

high cipher
#

lemme catch up

pliant shore
#

chatgpt

high cipher
#

what did it tell you to run?

pliant shore
#

i was telling him how to add my files to git and stuff he gave me commands and i dont know what happened

#

chatgpt is ahellll

#

for coding

high cipher
#

wait do you still have the .git folder

#

in your projsct?

pliant shore
#

but they are saved in my repo

fading kindle
#

Share that GPT chat if possible otherwise it's depends on you if sensitive

pliant shore
#

somehow

high cipher
#

locally?

pliant shore
#

on github

high cipher
#

oh good

pliant shore
#

i saw recent comments , clicked on my recent comments and all my files were there somehow

high cipher
#

well as long as you don't force push to github they'll still be there

#

so don't run anything else chatgpt says to

#

can you share the link you see your files on?

pliant shore
#

thats why i need proper guide to how to do this stuff

#

ok

high cipher
#

someone keeps trying to reset my Facebook password

ebon flame
high cipher
#

and I'm getting the SMS texts

#

super annoying

pliant shore
#

in the recent comments

ebon flame
pliant shore
#

can someone tell me proper guide to link vs code to github and operate?

#

please i am looking for hours

#

and chatgpt ruined it

high cipher
#

well first

#

do you have a copy of all your files locally?

pliant shore
#

nope how can i restore that recent comment "Initial commit" thing?
mean save them on my pc?
safely

high cipher
#

well let's get them on your pc first

#

initial commit is the one you want to restore?

fading kindle
#

@high cipher Enable MFA or passkey

analog abyss
fading kindle
high cipher
#

this set of files?

pliant shore
#

yeah exactly

#

thats some huge files

high cipher
#

go ahead and click the clone button and do download zip

#

before you do anything else

#

and put that in a safe place

pliant shore
#

ok wheres clone?

high cipher
#

sorry it actually says Code

pliant shore
#

oh ojkk

#

it will download everything in a zip?

high cipher
#

at that version yeah

fading kindle
pliant shore
#

okk so its downlaoding meaning i can downlaod them anytime too

fading kindle
high cipher
#

yeah, but github repo can be messed up

#

like there's command that will literally erase it

#

so keep a local backup

#

that's not on git

pliant shore
high cipher
#

yes

pliant shore
high cipher
#

you can checkout at an early version and force push that, and everything after that will be gone forever

#

it's a good thing chatgpt didn't say to do that

pliant shore
#

btw whats the ppush pull?

high cipher
#

can you take it from here @fading kindle

#

or others in chat

high cipher
pliant shore
high cipher
#

pull will get the changes from github to your local, push will push them up

high cipher
#

if you can push and pull from your local then everything should just work from vscode

#

vscode just runs git command like you would from command line

pliant shore
#

from chatgpt? hell nah

high cipher
#

no no

#

chatgpt probably told you to run stuff in your command line ? that use git?

pliant shore
#

yes

#

git add . etc

fading kindle
#

@high cipher right now I am going out for car wash so I can't but I can help out with pinging any others.

high cipher
#

well if pushing and pulling worked, then git is set up properly to work with github

#

and vecode just wraps around git command line

pliant shore
#

i created a new folder and repo how to link them and just tell me that how to add or change a file in github through vscode

#

Can you ping any other?

high cipher
#

what i do (because it's hard to create a repo from scratch on command line)

#

i create a new project on github, then I clone that on local

#

and everything will be properly see up for you to work on

pliant shore
#

wait wait

#

i created a repository on git hub ok now i need a system like that can add the files to my repo by the command line , it isnt whats other says?

#

i just listened that

high cipher
#

so

#

clone you project

pliant shore
#

i created a repo and i am doing someyhing to collaborate?

high cipher
#

i think you can do it from vscode but i do it from command line

#

you have the URL for your new project?

pliant shore
#

yes

high cipher
#

ok open up your command line

pliant shore
#

vs code?

#

terminal?

high cipher
#

no cmd

#

terminal yeah

#

where do you like to keep all your projects? you will want to cd to that directory

pliant shore
#

wait a min i have to log off for cmd to open

high cipher
#

k

pliant shore
#

ok opened

high cipher
#

you don't have a terminal app?

#

ok cd to the place you keep your projects

short elbow
#

I'd have thought the run window below the code in vscode might also do.

high cipher
pliant shore
#

its also a terminal

#

of the folder

#

so whats next

high cipher
#

are you in the directory for your projects?

pliant shore
#

i already did config,usernmae things by modi

pliant shore
high cipher
#

are you currently there

pliant shore
#

yes

high cipher
#

in the terminal

#

ok

#

whatever the github url is

pliant shore
#

mean to copy url?

high cipher
#

you can

short elbow
#

If you want to push back up, wouldn't an ssh URL be needed? (Unknown, i use ssh for my githubbing.)

high cipher
#

you can use http as well

short elbow
#

Ah cool.

high cipher
#

i doubt they have sah set up for github

high cipher
#

but idk

#

should work the same

pliant shore
#

this thing?

high cipher
#

yeah

pliant shore
#

ok next

high cipher
#

ok now your can just open folder in vacode

#

to the repo you clones

pliant shore
#

i already did

high cipher
#

then you're good

pliant shore
#

?

high cipher
#

you've got your empty project open

pliant shore
#

how?

short elbow
#

Did you git clone *the-url-here* ?

pliant shore
#

no commands?

pliant shore
short elbow
#

You can git clone the-github-url and optionally add a folder name for the clone to land in, otherwise it will use the base of the url as the new folder name

pliant shore
#

ok lemme do it

#

isnt it ""?

short elbow
#

?

pliant shore
#
  • url here *
#

ok it satrted cloning

#

is says done

short elbow
#

Yay. You should now have a new folder. Open that new folder in vscode.

pliant shore
#

and have a folder of my repo

pliant shore
short elbow
#

@high cipher still there?

pliant shore
#

i think he was busy

short elbow
#

Ok.

#

Does it looks like vscode sees the new folder, which should have a copy of the stuff from github.

pliant shore
#

so what if wanted to add a file directly from the terminal to github repo?

pliant shore
short elbow
#

Make the file locally. git add the-filename; git commit -m "some comment" the-filename
That adds it to the local git repo.
git push should push it up to github.

pliant shore
#

so i need to execute both 3 commands?

short elbow
#

So:

  • git add filename tells git to track that file
  • git commit tells git to save the current contents of the file to git - we do this for new changes
  • git push updates the upstream (github) from your local repo
#

There might be some funky vscode stuff for this - I don't use vscode.

pliant shore
#

so to push anything i made in vs code we use git push?

short elbow
#

Your git repo is complete and standalone. So is github. git push pushes any local update up to github. git pull pulls new changes from upstream (github) to the local repo.

pliant shore
#

oh

short elbow
#

Any edits you do locally aren't "in git" until you git commit them. Which is good.

pliant shore
#

can you give me a example so i can work on

short elbow
#

In a hour or so (ping me?) I need to go outsde and put the animals to bed - it's dusk.

pliant shore
short elbow
#

git add is only needed once, for new files. git commit adds new changes to modified files, to git. Locally. git push pushes commited changes from here to github.

pliant shore
#

so my local repo that is cloned , i made .py file and i want to upload it into github what exact things should i follow?

#

through the terminal?

#

😫

pliant shore
#

anyone back?

high cipher
#

you can actually do it from vscode

#

that's probably easier

pliant shore
#

thats why i opened this help

#

in local repo

high cipher
pliant shore
#

how to upload it into github through the terminal

high cipher
#

do you see that icon on the left

pliant shore
#

yes

high cipher
#

click that

#

send me a screenshot of what you see

pliant shore
high cipher
#

ok

#

so it says A for add

#

is already in the set of stuff that will get committed

pliant shore
high cipher
#

perfect

pliant shore
#

so i have to add a file firstly yeah?

high cipher
#

so you just need to type a message and click commit

#

yeah

#

you can hit "+" in vacode to do that i think

pliant shore
high cipher
#

if the file wasn't already added

high cipher
#

it just requires a message

pliant shore
#

whats is i added the file and now i have to commit it?

high cipher
#

yep

pliant shore
#

how to

high cipher
#

i just told you what to do didn't i

pliant shore
high cipher
#

if it's added you don't need to write the filename

#

but yes

#

you could also just use the UI

pliant shore
#

but it dont appear the button

high cipher
#

it is there

#

you just have to type something in the box

pliant shore
#

but not blue to be clickable

high cipher
#

you're not reading what I'm saying

#

type a message

pliant shore
#

[master (root-commit) 551ec69] add Scrip.py
1 file changed, 1 insertion(+)
create mode 100644 Script.py

high cipher
#

there you go

hazy saffron
#

wait

pliant shore
#

message?

hazy saffron
#

like binding github copilot to vscode?

high cipher
#

no he just means regular git

#

he's just trying to add files, commit and push them up

hazy saffron
#

ahh

pliant shore
hazy saffron
#

so like opeing a github repo's source code?

#

ok nbm

#

md

pliant shore
high cipher
#

yeah

#

git push

hazy saffron
pliant shore
#

fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using

git remote add <name> <url>

and then push using the remote name

git push <name>
pliant shore
high cipher
#

there should be a remote if you cloned from github

#

did you clone the repo from github?

pliant shore
#

i cloned with url didnt i?

high cipher
#

i don't know, is that what you did?

#

there should be a remote set up already

pliant shore
high cipher
#

you must not be in the directory you cloned into

pliant shore
high cipher
#

or there would already be a remote

#

did you cd into the folder after you cloned it?

pliant shore
#

lemme see

#

i have the same folder bro

high cipher
#

you should be in a folder called "TicTacToe-SpecialxAaalluu-Repo" that was created by git when you cloned

#

send me a screenshot of your terminal

pliant shore
#

git remote add origin <repo-url>

high cipher
#

bro im gonna let you figure out coz your not reading anything I'm saying to do

#

sorry

pliant shore
#

what ?

#

here what you wanted

high cipher
#

you are in a folder called github

high cipher
#

i don't think you cd into the tic tac toe folder

#

cd TicTacToe-SpecialxAaalluu-Repo

#

when you clone something from github, say github.com/user/reponame, it will say 'cloning into reponame..." - that creates the folder "reponame" with gir set up and the remote will already be set up too. you cd into that folder and that's where you do the work. or you can do file >> open folder in vscode, and select the "reponame" folder. if you work that way, when it comes to push the repo, it won't say there is no remote set up.

pliant shore
#

its the Github folder and has the repo named folder

#

is here i want to do

short elbow
noble birchBOT
#
Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.