Github Cheat Sheet - sammanthp007/Linux-Kernel-Development GitHub Wiki

Working with commits

Remove last commit from remote git repository

git push origin +HEAD^:<name of your branch, most likely 'master'>

Merge one change from an old branch to a new one

git checkout master
git checkout Feature 
git pull 
git merge master --no-commit --no-ff

# Analyze the changes that will be merged into your Feature
git commit 
git push

Deleting commits

https://ncona.com/2011/07/how-to-delete-a-commit-in-git-local-and-remote/

Working with local branch

Leave your current branch as is, create and checkout a new branch and keep all your changes

git checkout -b <new-branch>

Delete local branch

git branch -d localbranch

Working with remote branch

Push to remote branch

git push origin localbranch:remotebranch

Delete remote branch

git push origin :remotebranch

Creating Pull Requests

  1. On GitHub, navigate to the main page of the repository.
  2. In the "Branch" menu, choose the branch that contains your commits.
  3. To the right of the Branch menu, click New pull request.
  4. Use the base branch dropdown menu to select the branch you'd like to merge your changes into, then use the compare branch drop-down menu to choose the topic branch you made your changes in.
  5. Type a title and description for your pull request.
  6. Click Create pull request.

Look at small hunks of changes

# not sure though, check it out
git checkout -p <prev head>
⚠️ **GitHub.com Fallback** ⚠️