analysis.R
analysis-vers3.R
analysis2.R
analysis_redo.R
thesis-vers1.docx
thesis-vers2_CD+GM+SW_edits.docx
thesis-vers3_CD_edits.docx
mkdir example
cd example
git init .
echo "# My Project" >> README.md
git add README.md
git commit -m "Add README"
mkdir src/example
touch src/example/__init__.py
git add src/example/__init__.py
git commit -m "Initialize example package"
touch src/01-fetch-data.sh
chmod +x src/01-fetch-data.sh
touch src/02-verify-data.sh
chmod +x src/02-verify-data.sh
git add src/
git commit -m "Add scripts to fetch and verify source data"
git log
mkdir data
touch data/.gitkeep
git add data/.gitkeep
git commit -m "Keep data directory"
echo "*.csv" >> .gitignore
git add .gitignore
git commit -m "Ignore *.csv files"
echo "Source data from SOURCE" >> README.md
git status
git diff
git commit --all -m 'Update README'
git log
git log --patch
echo "mkdir data/derived" >> src/03-proc-data.sh
echo "cp data/raw/*.csv data/derived/" >> src/03-proc-data.sh
chmod +x src/03-proc-data.sh
git add src
git commit --all -m 'Add process script'
./src/03-proc-data.sh
ls data
ls -R data
git status
# Notice that csv files do not show up
git log
# opens in your pager (less), you can search etc.
git log | grep
# also works
git grep
# how is this different?
git checkout <commit>
# ... now what???
# Find the version you want first (see above), then ...
git checkout <commit> <filename>
# others ???
You've already got a repo, let's put that on GitHub.
git push
git push
git pull
You want to create a new repository starting from GitHub
git clone
You want to work on a shared respository
git clone
git pull --rebase
, then git push
Or, if you're using the typical GitHub workflow (aka, "GitHub Flow")
git clone
from your forkgit push
git clone --bare <original> repos/example.git
your original to the shared dirgit remote add proj <url>
git push