I was in GitBash and did "git add file" and "git commit -m "msg"" and "git push --all origin".
It pushed branches to the work GitHub Repository that I didn't want pushed (some mix up of old things from a different username).
I looked at the branches and a few files were there from my personal computer.
I clicked "branch" on the repository's front page, and deleted those branches that just got put into GitHub.
Did I successfully permanently delete those branches and all files so no coworkers can any longer see it? It seems the branches were never pulled based on below.
Also, when I did the push command, it said:
"delta compression using up to 8 threads" "writing objects : 100% (122/122)" "Total 122 (delta 7)" "remote: create a pull request for 'branchname' on GitHub" "[new branch] branch name --> branch name" "! [rejected] main --> main (fetch first)"
I'm concerned about this because there were only a few files in the branches that got to the repository, but this above makes it appear 122 objects were put into the branches. So I'm concerned I did not delete things I am not seeing that I pushed into the repository. Or is that probably not in the repository because of the "[rejected]" line?
Any help please? I just want to ensure no private life stuff goes into a work repository. Thanks. I'm not too bright on GitHub yet.
CodePudding user response:
"Objects" are the internal Git database thingies1 that make up commits, trees, files, and tags. The fact that git push
pushed 122 of them means that your Git had 122 thingies that their Git did not have.
Some of these thingies are actually files, and others are supporting objects. How many are which is not something anyone can say without more information. Each object has a type, and a raw hash ID—those big ugly hexadecimal numbers—that will let a Git retrieve the internal object, given the number and direct access to the repository. That is, the Git programs on GitHub could get them, if you know the numbers.
When you deleted the corresponding branch names on GitHub, you made it extremely difficult for anyone who did not already have the numbers, to find the numbers. However, the objects themselves are still there in the GitHub repository, and if someone can somehow guess the numbers, they can find them.
The "rejected" message means that some of those objects—the ones that would have gone into the GitHub repository and been findable through the main
branch—didn't go into the GitHub repository. GitHub stores objects in a temporary "quarantine" area, in case they're going to reject large (> 100 MB) files, and then they drop all the quarantined objects that didn't get stored. So some of the 122 didn't go in. How many of the 122 never went in at all, and how many are just impossible to find now, is not something anyone can tell you.
Someone at GitHub can make the GitHub repository eject any objects that did go in, via the branch names that you successfully created or updated but have since deleted. To make this happen, you need to get someone at GitHub Support to act on your behalf.
1Thingy, noun: highly technical term.
CodePudding user response:
[rejected] main --> main (fetch first)
means that main
in your local clone was behind the origin main
branch, and as the message says before pushing your local main
to origin you should have pull
d first.
This means that you didn't modify the origin main
branch.
As for the other branches, once you delete them from github they're gone, AFAIK.
Unless, of course, someone did a git pull
before you could remove them...