In here are instructions on the creation, maintenance, and use of this repository via git and GitHub. For more information, check out these posts:
Check this out:
- git - the simple guide just a simple guide for getting started with git. no deep shit ;)
- Git Tutorial
- What is git?
================================================================================
Create a new repository on GitHub. To avoid errors, its best not initialize the new repository with README, license, or gitignore files. You can add these files when you push your project to GitHub.
Go to GitHub and create the new repository called jupyter-notebook.
goto https://github.com/jupyter-notebooks
On your system where your project is located, open a terminal and change the current working directory to your local project.
Change to the jupyter-notebooks
directory, and initialize it as a git repository
cd ~/jupyter-notebooks
git init
Add all your source files, create a README.md
file
and create the file .gitignore
like this:
### ------------------------- Project Specific ------------------------- ###
### Videos & Images ###
*.mp4
*.avi
*.webm
*.mkv
*.png
*.jpg
*.tif
*.gif
### Jupyter Files ###
Untitled.ipynb
### ----------------------------- General ------------------------------ ###
### Compiled Source ###
*.pyc
*.com
*.class
*.dll
*.exe
*.o
*.so
### Packages ###
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
### backup file ###
*.backup
### Unit Test / Coverage Reports
htmlcov/
.tox/
.coverage
.cache
nosetests.xml
coverage.xml
### Logs & Databases ###
*.log
*.sql
*.sqlite
.ipynb_checkpoints
.ropeproject
__pycache__
### OS Generated Files ###
*.out
*.swp
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db
Now commit all these files to the git repository:
git add --all
git commit -m 'Initial creation of my project'
Initialize the local directory as a Git repository.
Within the jupyter-notebooks
directory, use git
to load the files to GitHub
To add a new remote,
use the git remote add
command on the terminal,
in the directory your repository is stored at.
cd ~/jupyter-notebooks
# set your remote repository URL
git remote add origin https://github.com/jeffskinnerbox/jupyter-notebooks.git
# verifies the new remote URL
git remote -v
# pushes the changes in your local repository up to the remote repository
git push -u origin master
NOTE: Other operations rename an existing remote, delete an existing remote.
================================================================================
Within the .vim directory, do a "get status" to see what will be included in the commit, add files (or remove) that are required, and then do the commit to the local git repository.
git status
git add --all
git commit --dry-run
git commit -m <comment>
To retrieve these updates on another system, use
git pull origin master
To overwrite everything in the local directory
git fetch --all
git reset --hard origin/master
Explanation: git fetch
downloads the latest from remote without trying to merge or rebase anything.
Then the git reset
resets the master branch to what you just fetched.
The --hard
option changes all the files in your working tree to match the files in origin/master
.
If you have any files that are not tracked by Git,
these files will not be affected.
To which shows you the URL that Git has stored for the shortname for the remote repository (i.e. GitHub):
git remote -v
Now to push your files to the GitHub repository
git push -u origin master
================================================================================
Copy this Git repository into your local systems:
cd <target-directory>
git clone http://github.com/jeffskinnerbox/jupyter-notebooks.git
To retrieve these updates on another system, use
git pull origin master
To overwrite everything in the local directory
git fetch --all
git reset --hard origin/master
Explanation: git fetch
downloads the latest from remote without trying to merge or rebase anything.
Then the git reset
resets the master branch to what you just fetched.
The --hard
option changes all the files in your working tree to match the files in origin/master
.
If you have any files that are not tracked by Git,
these files will not be affected.
================================================================================