Skip to content

Instantly share code, notes, and snippets.

@miawgogo
Created November 4, 2019 14:17
Show Gist options
  • Save miawgogo/d301fe7cc84f225bc6a6b821807b0cfc to your computer and use it in GitHub Desktop.
Save miawgogo/d301fe7cc84f225bc6a6b821807b0cfc to your computer and use it in GitHub Desktop.
Git

How to Git

to help people who have not worked with git before, or struggle to use it in a multi person project here are some guidelines and commands to follow. Also here are some links:

Guidelines

  • Do not work on the master branch, make a branch and work in there, peferably in a branch per task
  • Commit often, allows you to rewind work when you break something
  • Perferably merge using the pullrequests feature of github, this allows for discussion and also to automation of merging, It also allows for the automation of the project section
  • if there are 2 people working on the same feature branch, pull before starting work, pull before pushing too

Making and switching to branches

# create a new branch to store any new changes
git branch my-branch

# switch to that branch (line of development)
git checkout my-branch

Catching up to this repo

# this only pulls the current branch
git fetch origin
git pull origin

Catching your current branch to master

you dont need to do this very often, please avoid doing this unless you need changes from the master branch

git rebase -i master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment