Create a new (empty) project on econgit https://econgit.uzh.ch/dashboard/projects
use gitbash (MINGW64) to update projects https://mingw-w64.org/doku.php or gitbash
on git bash:
- first always go to the D drive: <cd D:>
- cd to the correct folder: <cd Irma/PEffort/analyse>
- clone a new project : click clone on econgit select either ssh or https, then go to gitbash and the correct folder above the project's folder then type: git clone (paste the link here). This will create the empty repository/folder.
- create all the files in this repo.
- create a gitignore.txt in this repo (this is to avoid econgit synchronising a large file that is mistakenly saved in the repo. Deleting the large file after the fact will not change the size of the repo, alas. So do use .gitignore. See below)
- on git bash, everyday, at the start of day: type (all within the < > mark):
1. <git status> This tell you if you're updated.
2. <git pull>. This makes sure you've downloaded changes you made in a different machine (eg, working at SNS lab and BLU on the same project)
- on gitbash, everyday (eg end of the day), update your changes.
1. < git add . > (don't forget the dot)
2. < git commit -m "your recent update">
3. <git push>
If you need to delete a repo on econgit, don't forget to create a local repo on sourcetree https://www.sourcetreeapp.com/ so you have the previous commits. DO NOT SIMPLY DOWNLOAD THE FOLDER.
Things to think about:
1. git is only for scripts, files with small sizes, do not save multiple .fig, .tif, .mat files in a git repo. Keep repo size < 300 Mb. Instead, create all_mats, all_plots folders outside the git folder, and code things to be saved there. SO: think about your folder architecture carefully before creating your repo (and still add .gitignore for the accidental savings).
2. Create multiple git repositories related to one big project, eg, 1 for experiment scripts, 1 for behavioural analysis, 1 for mri analysis, etc. You can name them with the same beginning of the repo names, and clone these separate repos under the same project folder in your machine.
What to put into .gitignore.txt (example):
# MATLAB data file
*.mat
# Eyetracking files
*.edf
# Microsoft Office
*.doc
*.docx
*.xls
*.xlsx
*.ppt
*.pptx
# generated files
*.zip
*.fig
*.tif
# logging files
*.log
# ignored folders
sandbox/