#π I am trying to push(to github) but still stuck on the same problem for 2 days..
159 messages Β· Page 1 of 1 (latest)
@untold coral
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.
your repos origin and local repo are out of sync
i tried pulling ..pulling is working but not pushing
pulling is not actually working...it's showing a fatal error in your screenshot
so what should i do
do you own ASL2025 btw?
yes
do git remote -v
ahh makes sense now
git remote rename original origin
do this to rename back to the original repos's remote url name
then git pull again and push
can you do git fetch first before git pull
only 'git fetch'?
yeah
nothing happened
did you by chance accidetanlly delete your .git folder at any point?
the issue is definitely not the github, it likely ur local changes
i used rebase yesterday
3 to 4 commits per repo
i was trying to save my changes on github..so i was pushing all my repos
but it worked only once
a single git repo cannot contain multiple sub git repos
and then the error came like in the first ss
i did it differently..i mean i was pushing repos one by one
wait what
ur supposed to be in the 100-days-of-code folder when u do these commands
did you change the repo name?
no.but both repo are raising the same error
what is ~/shopping folder contains
okay...so that's shopping folder contents right?
can you show me the full screenshot of git log...it cuts out at the right side
of shopping repo?
yeah
just to be sure, you closed 100 days of code repo made changes and commited and also rename the folder name right?
i can't the see the full thing on the right...what's first
branch
great
but main branch is still giving the error
what error?
ahhhh
you accidentally remove the remote for that branch
do git branch --set-upstream-to=origin/main main
then git pull
what happens with git pull origin main
same error
did you rebase ?
exact same error?
yes
i did it yesterday..and my two folders got deleted
day 11 and day 12
show git log again...
first stash all changes
i never did stashing and rebasingbefore
Stashing so that current changes doesn't get lost in process
it's better for them to just backup the entire folder somewhere else
instead of dealing with stashing and rebasing, and screwing up the repo
i find stash better
stashing mid debug isn't exactly a solution
then we can checkout to main and pull,
then back to branch and rebase and see
we're already in main tho, what's weird is pulling is causing issues with merging
usually u would expect a merge conflict, but instead we're getting unrelated histories which suggests something esle
do git status
it's empty nothing in staging area
we can force it
no, i'm trying to do this without force
since some commits are missing from the tree
i tried force but it overwrites the files in github
@slim pike it was done here
force it
why are you not doing in vscode or somethign
let me tell you one more thing...in 100 days of code folder, my files got deleted
what does vc code have to do with this
no
day 11 and day12
that's not a solution either
git push --force original main
But use this only if you're sure you want to erase the remote's history and replace it with your local repo.
stop suggesting things that will harm the repo
so i said stash it
but while writing ls in shell it shows day 11 and day12
look we want to preserve the orignal repos commits not overwrrite them with force
git reset --hard origin/main
you have to be trolling
@untold coral do not run reset hard
it will lose ur local changes
also stash only applies to unsaved commits afaik
in this case they already commited
okay this is not productive...we already went over this
so no results again?
most likely u will need to do interactive rebasing...but since the first commit does not match the origin, even that won't solve the issue
better join vc
at this point, it's probably easier to just cherry pick all the commits from the remote (main) into the local main and then do an interactive rebase
could be
i got to go now....can you tell me in a nutshell what to do
can we somehow continue this later?
do a git clone in a different directory and push in a new branch there
some manaul effort but better
- Create a new remote called original_main pointing to the 100 days repo
- do git remote update to get all the original main commits
- while inside local main, cherry pick the commits from original_main's main branch
- git push
- remove original_main remote
- do interactive rebase to put the cherry picked commits in correct order
- git push π
it's basically a lot of work...if you have many changes tho it's worth it
do you think he won't mess up
prolly will for sure
seeing as this is a repo just for learning...it's prolly way easier to just clone the repo again and do the commands properly this time around
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.
