Just a bunch of git related things (I keep forgetting how to do them!)
How to add new files to an existing Github repository
# first create your repository in github cd ~/your-files-to-add/ git init . git remote add origin git@github.com:yourname/yourrepo.git git pull origin master git add "list-of-files-to-add-to-github" git commit -m "some comment" git push
How to update a forked github repository from the web interface
If you have forked a github repository and need to update it do this:
- Login to your github
- Navigate to your forked git repository
- Click “pull request” at the top
- in the “base repo” drop down, change it from the main one to your forked repository
- in the “head repo” drop down, change it from your forked repository to the main repository
How to checkout a single directory from a github repository
This is called sparse checkouts, it is possible but requires a little bit of fiddling.
cd ~/path-to-checkout-files-to/ git init . git remote add origin git@github.com:yourname/reponame.git git config core.sparsecheckout true echo "folder-name-to-checkout" >> .git/info/sparse-checkout echo "some/other-folder" >> .git/info/sparse-checkout git pull origin master