GIT Pull and Push request

Posted under » Version Control on 30 April 2021

Instead of SVN update or clone, you pull to start working with a GIT repo from Github.

$ git pull origin main
$ git pull origin vbox

Where vbox is a branch of main. You can then set the location to the branch so later you can push to the correct repo branch.

git branch -M vbox

You will update your local from github. Git pull does a git fetch followed by a git merge to update the local repo with the remote repo.

You may push to github if you are are the owner and a collaborator that doesn't require pull request. if not, then as a collaborator, you need to ask for a pull request.

To me a "pull request" is a merge request from a collaborator to the owner. A "pull request" is you requesting the target repository owner to please grab your changes from your forked repo.

Pull requests are a feature that makes it easier for developers to collaborate using Github. They provide a user-friendly web interface for discussing proposed changes before integrating them into the official project.

This is an example of a pull request

To create a branch, you "fork" the project first. This project then belongs to you. Go to a folder and clone to your local.

$ git clone git@github.com:anoneh/yourproject.git

To clone a specific branch.

Create a branch by

$ git checkout -b newbranch

Make changes to the file or files. Commit and then push to github.

Go to the repository page on github. And click on "Pull Request" button in the repo header.

The owner can use github's "Merge pull request" button to merge your changes. This is only available when github can detect that there will be no merge conflicts with the base branch. If all goes well, the owner just have to add a commit message and click on "Confirm Merge" to merge the changes.

web security linux ubuntu python django git Raspberry apache mysql php drupal cake javascript css AWS