Basic workflow I've been following, inspired by the RailsTutorial website.
Branch -> Edit -> Commit -> Merge -> Push
git init => Create a new repository in the current directory
git add => Add file to current changeset.
git add -u => Add files that may have been locally deleted.
git commit -m "<message>" => Commits the files 'added' to the local repo
git checkout -f => Checkout previous commit overwriting all changes.
git checkout -d <branch_name> => Checkout and create a branch
git checkout master => Checkout the main branch
git merge <branch_name> => Merge branch back into master
-
Create github repo via web
-
Add github repo as origin
git remote add origin [email protected]:username/project.git
-
Push local repo to github (first time only)
git push origin master
-
Once you have your local changes commited push to github
git push