Skip to content

About

Frequently used series of commands in Git

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 

Repository files navigation

git-cheatsheet

Frequently used series of commands in Git

Start a new branch and push it to GitHub

  1. Create and switch to a new branch (here: featurebranch)
git checkout -b featurebranch
  1. Examine your branches
git branch -vv
  1. Stage and commit your changes
git add myfile
git commit -m "My commit message"
  1. Push the new branch to GitHub
git push origin featurebranch
  1. Start tracking the remote branch
git branch -u origin/featurebranch
  1. Create a pull request on GitHub

  2. Continue committing on the branch and pushing while discussing development with collaborators on GitHub

Merge a local branch, delete a local branch, push changes, delete a remote branch

  1. Switch to receiving branch (here main)
git checkout main
  1. Merge feature branch (here: featurebranch)
git merge featurebranch
  1. (Eventually manage merge conflict)

  2. Delete local feature branch

git branch -d featurebranch
  1. Push changes to main
git push
  1. Delete remote branch
git push origin --delete featurebranch

About

Frequently used series of commands in Git

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors