Skip to content

Instantly share code, notes, and snippets.

@weirdbricks
Last active August 29, 2015 13:56
Show Gist options
  • Save weirdbricks/8980223 to your computer and use it in GitHub Desktop.
Save weirdbricks/8980223 to your computer and use it in GitHub Desktop.
starting-with-a-new-repository
1. Create new repository, go here:
https://github.com/new
2. Give it a name and tick 'Initialize this repository with a README', then click on 'Create Repository', for this example the name will be 'reload-jail'
3. On your shell initialize the new repository:
git init reload-jail
4. Go into the repository directory:
cd reload-jail/
5. Add the remote repository:
git remote add origin git@github.com:weirdbricks/reload-jail.git
^You get the above link by going to your repositories (https://github.com/weirdbricks?tab=repositories), click on your repository and copy the 'SSH clone URL'
6. Before you push you'll need to have your SSH keys in place - check for your current user with:
ls ~/.ssh/
If you don't have keys, create them with:
ssh-keygen
Copy the PUBLIC key only (usually the file ~/.ssh/id_rsa.pub provided you took the defaults when creating the SSH key)
Paste the key here: https://github.com/settings/ssh
Test that your key works with GitHub to retain sanity:
ssh -T git@github.com
You should get a prompt to add github.com to the list of known hosts, answer 'yes' and you should get:
Hi weirdbricks! You've successfully authenticated, but GitHub does not provide shell access.
7. Set your username and e-mail for commits:
git config --global user.email "weirdbricks@myopera.com"
git config --global user.name "Lampros"
8. Sync the remote with the local repository:
git pull origin master
8. Create a test file, add it, commit it and push it:
touch test.txt
git add test.txt
git commit -m 'testing'
git push origin master
9. Delete the repository - GONE FOR GOOD! be careful :)
go here: https://github.com/weirdbricks/reload-jail/settings
and click on 'Delete this repository'
10. Delete it locally by simply removing the directory:
rm -r -f reload-jail/
Note1:
If you're getting this error when you're trying to push:
You can't push to git://github.com/weirdbricks/reload-jail.git
Use https://github.com/weirdbricks/reload-jail.git
Fix with:
git remote set-url origin git@github.com:weirdbricks/reload-jail.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment