#π Visual Studio Code Binding With Github
304 messages Β· Page 1 of 1 (latest)
@pliant shore
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.
Hello anyone?
How can help you
Open vs code
ok
The terminal
ok
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]"
my github username?
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
π
Yes na
he ended up giving me commands that deletd my whole fileesss
done
I have given commands to you for checking up version, lemme ping any engineer π
ok
@high cipher
i am so confused i want to collaborate with someone at night , but so frustrated
can you see our whole chats its frustrating
.
lemme catch up
who did?
wtf
chatgpt
what did it tell you to run?
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
but they are saved in my repo
Share that GPT chat if possible otherwise it's depends on you if sensitive
somehow
locally?
on github
oh good
i saw recent comments , clicked on my recent comments and all my files were there somehow
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?
someone keeps trying to reset my Facebook password
if this wasnt enough for u to figure it out: dont use chatgpt and specially dont blindly copy paste stuff from chatgpt SPECIALLY terminal commands . . .
in the recent comments
just be like me, delete facebook account
can someone tell me proper guide to link vs code to github and operate?
please i am looking for hours
and chatgpt ruined it
nope how can i restore that recent comment "Initial commit" thing?
mean save them on my pc?
safely
@high cipher Enable MFA or passkey
yes
Github lets you browse a repo's files at a specific commit, you can download them here https://github.com/sarimgamerop-cloud/Tic-Tac-Toe-Game-SpecialCodes-x-Aaalluu-/tree/3346738076c8c3639ad27673251f4a7169f23416
you can also roll back to a specific commit in your local Git rep by doing git reset <commitID>
The commit before the one that deleted your files has an ID of 3346738076c8c3639ad27673251f4a7169f23416, so you can use:
git reset 3346738076c8c3639ad27673251f4a7169f23416
For facebook
this set of files?
go ahead and click the clone button and do download zip
before you do anything else
and put that in a safe place
ok wheres clone?
at that version yeah
Yes
okk so its downlaoding meaning i can downlaod them anytime too
Sorry for disturbing
BTW what is happening with your Facebook profile
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
they can remove recent commits?
yes
dangerous
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
btw whats the ppush pull?
synchronizing with online repo
but no one told me how to srtup it
pull will get the changes from github to your local, push will push them up
oh ok
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
from chatgpt? hell nah
@high cipher right now I am going out for car wash so I can't but I can help out with pinging any others.
well if pushing and pulling worked, then git is set up properly to work with github
and vecode just wraps around git command line
ok
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?
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
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
i created a repo and i am doing someyhing to collaborate?
i think you can do it from vscode but i do it from command line
you have the URL for your new project?
yes
ok open up your command line
no cmd
terminal yeah
where do you like to keep all your projects? you will want to cd to that directory
wait a min i have to log off for cmd to open
k
I'd have thought the run window below the code in vscode might also do.
oh good point, that would work as well
thats what i am doing
its also a terminal
of the folder
so whats next
are you in the directory for your projects?
i already did config,usernmae things by modi
i created a new folder for all of this stuff
are you currently there
yes
in the terminal
ok
do git clone https://github.com/abc/xyz
whatever the github url is
mean to copy url?
you can
If you want to push back up, wouldn't an ssh URL be needed? (Unknown, i use ssh for my githubbing.)
you can use http as well
Ah cool.
i doubt they have sah set up for github
yeah html
this thing?
yeah
ok next
i already did
then you're good
?
you've got your empty project open
how?
Did you git clone *the-url-here* ?
no commands?
nope
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
?
Yay. You should now have a new folder. Open that new folder in vscode.
now i can see everything in my vs code?
@high cipher still there?
i think he was busy
Ok.
Does it looks like vscode sees the new folder, which should have a copy of the stuff from github.
so what if wanted to add a file directly from the terminal to github repo?
yeah i didnt uploaded something yet
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.
so i need to execute both 3 commands?
So:
git add filenametells git to track that filegit committells git to save the current contents of the file to git - we do this for new changesgit pushupdates the upstream (github) from your local repo
There might be some funky vscode stuff for this - I don't use vscode.
so to push anything i made in vs code we use git push?
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.
oh
Any edits you do locally aren't "in git" until you git commit them. Which is good.
can you give me a example so i can work on
In a hour or so (ping me?) I need to go outsde and put the animals to bed - it's dusk.
so to upload a file to git from vs code i need to git add , commit and then git push?
π
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.
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?
π«
you add the file first
anyone back?
how to
thats why i opened this help
i added a script.py file
in local repo
how to upload it into github through the terminal
do you see that icon on the left
yes
perfect
so i have to add a file firstly yeah?
so you just need to type a message and click commit
yeah
you can hit "+" in vacode to do that i think
2nd step
if the file wasn't already added
yeah once it is staged you're ready to commit
it just requires a message
whats is i added the file and now i have to commit it?
yep
how to
i just told you what to do didn't i
if it's added you don't need to write the filename
but yes
you could also just use the UI
but it dont appear the button
but not blue to be clickable
there you go
wait
message?
like binding github copilot to vscode?
ahh
ok so i have to git push?
yeah
why dont you just download the zip and import it to vscode?
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>
now we are trying to do a how to upload the changes back on the repo
there should be a remote if you cloned from github
did you clone the repo from github?
i cloned with url didnt i?
so if its not we can set up , byt thats not natural as we cloned it?
you must not be in the directory you cloned into
did this
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
git remote add origin <repo-url>
bro im gonna let you figure out coz your not reading anything I'm saying to do
sorry
you are in a folder called github

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.
You do if the commit is only for the changes in that file.
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.