Initialise new repository and push
Change to the project directory. Ensure .gitignore file has been created in directory and initialise git repository.
git init git add . git commit -m "Bootstrap project"
Create new repository in GitHub and push
git remote add origin https://github.com/ianhomer/my-project-name.git git push -u origin master
Simple clone, add, commit and push
git clone email@example.com:ianhomer/ianhomer.git git clone https://github.com/ianhomer/ianhomer.git
Add all, new and modified or modified and delete.
git add -A git add . git add -u
The credentials helper can help reduce password re-entry for HTTPS URLs. Note that For SSH URLs a SSH key is used to authenticate. Enable the credentials helper on OSX with - see Caching your GitHub password in Git for other systems.
git config --global credential.helper osxkeychain
Create a downstream only fork.
This pattern is useful for small prototypes and learning exercises based on base line project with no intention to push changes back upstream. Create “my-exercise” repository in GitHub web interface
git clone https://github.com/ianhomer/purplepip-project my-exercise cd my-exercise git remote set-url origin https://github.com/ianhomer/my-exercise git push -u origin master
Add upstream repository and disable upstream pushes
git remote add upstream https://github.com/ianhomer/purplepip-project git remote set-url --push upstream DISABLE git remote -v
To sync the fork, you can fetch upstream changes and merge into local master
git fetch upstream git checkout master git merge upstream/master