The Best Git Commands for Dev

The most common part is:

The basic cycle

git pull master to get up to date

git checkout -b myname-feature to get a branch of your own

git add <files> that you changed/created
git add . to add everything in the current directory
git add -u to add all existing files in the repo

git commit
git commit -m "multiline commits" -m "without text editors" -m "wow!"

git push -u origin myname-feature the first time, git push after that

git branch -D myname-feature when it gets merged into master and you don’t need it cluttering your autocomplete anymore

Also read on

  • cherry-pick
  • reset commit
  • reset a file

The complete info is available at:

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: