Git commits not showing on repo that I forked - github

So, my friend made a repository, made me a collaborator, I branched out, forked and then cloned into my IDE.
Everything went fine with that, did some small changes and then wanted to test commit and push.
Commits and push went to my friends repo, everything is fine there, but they are not showing on my fork.
I'm doing it this way (hope it's not the wrong way) to practice these kind of things and I would like to have that project on my profile after I'm done.
Thanks.

Quoting from Github's docs:
"A fork is a copy of a repository.."
A fork essentially creates a separate repo. If you were committing and pushing to your friend's repo, your forked copy has no idea about it unless you push them to your repo also, or merge your friend's repo into your fork.
Ideally, you should never push to the original repo (your friend's repo) at all. Commit and push to your own repo by changing the remote, and when you want your commits to reflect in the original, you should raise a Pull request (assuming you're using GitHub).

You cloned it into your IDE, so you are editing his repo directly. No longer forking.

Related

What is the best practice to get the updates from another repo without making any PR after changes?

I'd like to know how to proceed in GitHub where I could to be able to get the updates from the original repo but prevent opening a PR after each time I push a change made by myself?
The concept I want to apply this is to use a blog template for my GitHub pages. I'd like to get the feature for the future if the contributors would make any but at the same time, I'd like to prevent pushing anything to the original repo as a PR since those commits wouldn't include anything related to making a contribution to the project.
PRs aren't generated automatically, you need to explicitly create them from a branch.
You can fork a repo and work on it, and when needed, fetch and rebase from the original repo you forked from. As long as you don't explicitly use this repo to create PRs on the original repo, you should be fine.
EDIT - Adding some details as per the last comment:
Assume there's a repo called something owned by someone. You can start off by forking it to youruser using the GitHub UI. Then you can clone your fork and work on it:
git clone https://github.com/youruser/something.git
In order to get the recent changes from the original someone/something repo, you need to set it up as a remote. By convention you'd call this remote your "upstream", but you can really give it any name you choose:
git remote add upstream https://github.com/someone/something.git
Once you've added it as a remote, you can fetch from it and rebase on top of it:
git fetch upstream && git rebase upstream/main
(note that using the main branch is just an example. You can of course rebase on top of any branch in the remote repo)
I think it's not possible because when you clone or fork that repo, from that time, you start to add your own content to it since it's your personal blog. So you cannot keep getting the features from main repo. Maybe you can try rebase but I'm not sure if it works for this case. Or you can add those features to your repo by your own whenever you need them.

Can't to push commits from local branch to github repository

I was committing and pushing in ordinary for my repository.
but once i used command of git checkout for change to the previous version of my repository.
after that i tried to commit and push, then it can not completed.
i try to use the --no-verify command to push the commit but it also not success.
error: failed to push some refs to 'https://github.com/ruwanliyanage123/Hair-4-U-Hospital.git'
i want to push my commit into github repository
Since you switched to a previous version of your repository, your head is most probably detached. You can't just go back anywhere in your history and make commits.
Consider making a branch from there and then commit to it.
Try to first check in which branch you are working do git branch, check is the one you are working. Then I sometimes do git pull to just make sure that the connection is working this should not delete your progress the you should be able to do git push. If you are afraid youll mess up first do a local back up of all project files except for the .git one which are hidden by default in windows.Lastly I would suggest never posting the actual link to your github repository in case whatever you are working is important, you can just replace with
https://github.com/user/projectname.git

Is it possible to modify a Github repo's contents at a previous commit and then link to that modified commit in requirements.txt?

I'm currently pulling in a repo at a previous commit with:
git+git://github.com/username/application-name.git#357y3530u325#egg=application-name
I want to modify some code at that commit, so I have forked the repo.
Is it possible to modify a Github repo's contents at a previous commit and then link to that modified commit in requirements.txt?
It would be good if I could do it all via the Github website, as opposed to cloning to local, modifying and pushing etc, if that is possible.
You can create a branch in your fork of the repository, make your changes and push them back into your branch on Github. Then change the repository specification (including commit number or branch name) to point to that.

Update all branches on forked repo with github.com?

I have a forked repo. The original repo has been updated and I need to pull in these changes. I would prefere to use github.com for this rather than the command line if possible.
From the github.com page of my fork I have a button called Compare which allows me to compare my branches with the branches in the original repo, and merge if there are changes. This should do what I want except that the changes I need to update are in a new branch that isn't in my repo.
IMHO, the best way to do this is by installing the Pull app in GitHub.
After forking a repository, you can then enable the app for the
repository, and then configure the app for the forked repository. 🙂

Github - merging fork into master (locally)

So i have the following problem:
Back when i started programming, i FORKED a repository (using github for windows) for a browser-game. For some time now, i made stuff, did git commit and issued a pull request using the webpage.
The original author did authorize my pull request and my changes went live.
Recently, i have become an "official" author on the original repository.
So i dont want to work on my "fork" any longer but instead dev on the original.
Using github for windows, i decided to "clone" the original repo.
My github now shows my forked (AncientSion/FieryVoid) repository and the original (Aatu/FieryVoid).
Now what i would like to do is somehow "merge" my forked repo into my local clone of the original repo and from there commit to the master repo directly, that way deploying my local, not yet commited changes from my fork to the live version while at the same time getting rid of fork repository.
However, i have no idea if that works and if it does, how.
Can someone please advise ?
I don't think that the Github for Windows interface supports this, but this can definitely be done via the git bash console. This is untested, but the steps ought to be correct, since I've done something similar (identical, in fact) before. This assumes that your clone, AncientSion/FieryVoid, is up-to-date with Aatu/FieryVoid, which can be done with a pull followed by a merge, or, to avoid merge commits, with a git pull --rebase. So now you have AncientSion/FieryVoid and Aatu/FieryVoid, both present locally, with AncientSion/FieryVoid ahead of Aatu/FieryVoid by a few commits. What you need to do is pull in those commits into Aatu/FieryVoid by running the following:
cd path/to/local/clone/of/Aatu/FieryVoid
git remote add local_pull path/to/local/clone/of/AncientSion/FieryVoid
git pull local_pull master
git push origin master
Couple of assumptions:
You were working on the master branch of AncientSion/FieryVoid. If not, replace master in line 3 with your branch name.
origin is a remote that tracks the online repo Aatu/FieryVoid