Developing some familiarity with the command line will come in very handy.
pwdcd PATHcdcd takes you to your
home directory
rm PATHrm -r PATHcp SOURCE DESTINATIONcp -r SOURCE DESTINATIONmkdir PATHmv SOURCE DESTINATIONWhen using paths on the command line you will come across some conventions.
...~/home/alice (Linux
etc.) or /Users/bob (Mac OS)
//home/alice/Desktop/code/2024-zebrafish-plots if you are in
the Desktop you could move into the plots directory in many
different ways:
cd /home/alice/Desktop/code/2024-zebrafish-plots cd ~/Desktop/code/2024-zebrafish-plots cd ./code/2024-zebrafish-plots cd ../alice/Desktop/code/2024-zebrafish-plots cd ./code/../code/../code/../../Desktop/code/2024-zebrafish-plots
The last is very silly on purpose to show you relative path movements.
You will come across the concept of absolute and relative file paths.
/home/alice/Desktop/code/2024-zebrafish-plots/home/alice/Desktop/code/2024-zebrafish-plotsTo install git follow the official instructions for your operating system:
homebrew)
If you haven't used git on your computer before.
git config --global user.name "FIRSTNAME LASTNAME" git config --global user.email "YOUR-EMAIL"
Whenever you make a commit your name and email are used for the 'author' metadata.
You can also run the following to make git command output easier to read.
git config --global color.ui auto
Inside the folder you want to version control: git init
This will create the hidden .git directory that git uses as
storage.
Cloning creates a copy of an existing repository on your machine. Depending on the address you use when cloning it will use a different form of authentication.
git clone git@github.com:erkannt/crop-and-rotate.git
git clone https://github.com/erkannt/crop-and-rotate.git
The workflow is always:
git add .git add PATHgit add -pgit commit -m "MESSAGE"git commitgit restore PATHgit restore --staged PATHgit reset --hardThere are a variety of ways to see what has happened in the past and what your current state is.
git statusgit loggit log --graph --oneline --decorate --branches --all
git diffgit showgit show SHAgit log)
git pullgit pushgit pull --rebasegit remote -v