I want to contribute to my friend's repository. He has added me as a collaborator. How can i create a new branch from my friend's repo and contribute to it. I have read other StackOverflow questions. They are suggesting to fork the repo and then work on it and create a pull request. For example this one
But i want to directly make branch from friend's repo and contribute to it. What are the steps. I dont find any detailed answer. Any help would be appriciated.
The first step is to clone the repository from your friends server/computer or where ever it is. This creates a local copy of the current state of the repository on your machine.
$ git clone <friends' repository url>
Then you can create and check out a new branch in your local repository:
$ git checkout -b myNewBranch
After applying changes, you have to stage the changed files using git add and commit them using git commit.
When you're finished making changes, you can use git push to push your new branch and the changes made to the remote repository. Be aware that your changes still only exist on your branch and are not merged in any other branch. If you want your changes to be visible in the master branch, for example, you have to open a pull request to merge the changes from your branch into the master.
It seems you did not read much documentation on basic git workflows. If you want to work with git, you should read some manuals, tutorials and documentation to deepen your understanding of what you're doing (this is a good start). Copy and Paste will only bring you this far and always is potentially dangerous if you do not know what you are doing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With