Keep your repo up to date
git clone- creates a local copy of the repository for you to work in
git clone https://github.com/username/pan.dev.git
Use this when you have not yet created a copy of the repo locally
git pullpulls changes from repository you cloned and merges them into their respective branches
Use this when you want to grab changes that have been pushed to the repo you are working on and bring them locally
git fetchreaches out to repository you cloned to ask if there are changes, does not merge them
Use this to see if if there are changes without merging them
branch-nameinto your working branch
git merge `branch-name`
Use this to get your repo in sync with another branch.
caution this could result in a conflict, more on that later
Keep track of your work
git checkoutcheckout a branch or create a new branch and check it out
git checkout -b branch-name
Use this to switch branches or create a new branch off of your current branch
git branchsee which branch you are working in and other available branches
Use this to keep track of where you are and which branches you have locally
git statussee all files with changes you've made in your working branch
Use this to see what changes have been made (whether on purpose or accident)
git add <filename>adds a file you've edited to be staged for a commit
git add docs/contributing/git_basics
git statusto see which files have changed and
git addto pull out only the files you want to commit.
git add .will add all changed files.
git committakes all staged files and bundles them into a commit
git commit -m "summary of the commit"
Use this to combine your changes and prepare to push for others
git pushtakes a commit and pushes it to the repository
git push origin branch-name
Use this to push the changes to the repository where you can share them with others or merge them into the main branch