just ram

stuff I should remember

Git feature workflow - basic commands

List of basic commands to use during feature branch workflow.

Create feature branch

1
git checkout -b my-awesome-new-feature

NOTE: The -b parameter means branch, it saves us having to use two separate git commands. Without this option we’d need to branch then checkout.

Now do lots of work on the new feature…

Find out what has changed

When finished working on the new feature find out what has changed.

1
git status

Add changes to git

Either add each file manually using:

1
git add my-changed-file.txt

Or add all the files in the current directory.

1
git add .

Run git status one more time to get a list of everything that is going to be committed.

NOTE: Accidentally added files can be removed using the command git rm <filename>

Commit changes

Commit your changes with a meaningful message.

1
git commit -m "my awesome new feature, this changes everything!"

Push changes

Push the new feature up to github so we can do a pull request.

1
git push origin -u my-awesome-new-feature

The new branch should now be visible on github and we can now issue a pull request.

Comments