Skip to content

Instantly share code, notes, and snippets.

@jermainedilao
Last active December 4, 2018 08:19
Show Gist options
  • Save jermainedilao/4f6e3ba30f16c701b31597f0a489a8d4 to your computer and use it in GitHub Desktop.
Save jermainedilao/4f6e3ba30f16c701b31597f0a489a8d4 to your computer and use it in GitHub Desktop.
Basic steps on pushing new branch to git repo.

Steps when committing changes.

  1. To add all your changes for commit, run git add .
  2. To commit all changes you added in step 1, run git commit -m "<Insert commit message>"

After committing, follow the steps below.

Steps when pushing a local branch to repo.

  1. Always check for changes from the branch you checked out from before pushing. (let's say your branch was checked out from master. Check if there are any updates from origin/master)
  2. Run git fetch to check if there are any updates. If there are updates run git rebase origin/<insert_branch_where_you_checked_out_from_here>
  3. If there are no conflicts. Run git push origin HEAD to push your branch to the repo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment