Version Control and Collaboration With Git
Version Control and Collaboration With Git
collaboration with
Git and Github
Katia Oleinik
Research Computing Services
Challenges of working on a project
From README file of the source code: "- global information tracker": you're in a good mood,
and it actually works for you. Angels sing, and a light
suddenly fills the room.
- "g*dd*mn idiotic truckload of sh*t": when it breaks
Git main features
Track all your changes
Create a snapshot
Make a commit
when ready
Username: tuta#
Password:
Note:
• Username and password are case-sensitive
• password will not be displayed while you
are typing it
Git : basic configuration
Interpreter program
command flag key value
Notes:
• Vim is the default editor used by git
• Select gedit if you are not familiar with vim or emacs editors
Git : basic configuration
Git : advanced configuration
System
• Usually in /etc directory overrides
Global
• ~/.gitconfig
overrides
Local
• .git/config
Git : create a repository
# list the files in the directory including those starting with a dot
Git : explore a repository
Git : 4 statuses
unmodified • Git knows about file, but it has not been modified
modified • Git knows about the file and it has been modified
Note: if you are not familiar with vim or emacs editors, used gedit to edit files:
gedit hello.py
Execute python script (optional)
Git : check the status
Git : add file to the repository
#check status
Staged file
Git : commit
Note: Only first 7 symbols of SHA-1 key are necessary to identify the checkout
Git : returning back to the last commit
Git : hard delete of the latest commits
Git : Renaming the files (git way)
#commit
Git : Renaming the files (outside git)
#commit
#commit
Git : Deleting the files (outside of git)