- Present the need for version control
- Basic concepts of Git
- Use cases of Git
- Convince you that git is the only solution
- Go through everything together
Software aiming at storing different versions of files in a structured way
A collection of files that are being tracked for changes
A subset of changed files, that will be included in the new version
A collection of changes in individual files (i.e. version)
Copy of the repository located in other locations
An independent line of development
Go to folder that contains the files for the repository
git init
When inside the repository
git stage file1 file2 ... // (Adds file1 and file2 to staging area) git stage . // (Adds all files and subfolders in current folder) git stage folder/ // (Adds all files in folder)
git commit -m "Your commit message here"
git log
commit bc878077638d507e0acd895bb595cc94526ec542 Author: Tassos Natsakis (nakano)Date: Fri Apr 3 16:00:23 2015 +0200 "Adding function that reads pressure data and exports them in a CSV file, with the coordinates that they should be applied to, in a FE simulation" commit dff63cd96c10756ff6c429ca0e705bc6ca25228c Author: Tassos Natsakis (nakano) Date: Fri Apr 3 15:59:37 2015 +0200 "Finding some more small bugs introduced when I was working in a hurry" ...
git diff (filename) commit1 commit2
diff --git a/peakAreaTalus.m b/peakAreaTalus.m index 4c5a518..4eab54a 100644 --- a/peakAreaTalus.m +++ b/peakAreaTalus.m @@ -1,10 +1,10 @@ function pressureArea =... peakAreaTalus (data, rows, cols, measPathName, legendNames,... - rowSpacing, colSpacing) + rowSpacing, colSpacing, toPlot)
git checkout commit_hash
git blame filename
d96873d1 (jhbecker) 2012-06-10 13:39:56 +0200 108) d96873d1 (jhbecker) 2012-06-10 13:39:56 +0200 109) \DeclareComplementaryOptio... 9c369fc5 (Wannes) 2013-01-10 13:17:15 +0100 110) % Cover options 9c369fc5 (Wannes) 2013-01-10 13:17:15 +0100 111) \DeclareStringOption{cover... c813ae79 (Wannes) 2013-03-23 15:28:20 +0100 112) \DeclareBoolOption{coversh... c813ae79 (Wannes) 2013-03-23 15:28:20 +0100 113) \DeclareComplementaryOptio... 9c369fc5 (Wannes) 2013-01-10 13:17:15 +0100 114) 07c6d277 (Yves) 2010-09-02 22:53:52 +0200 115) % Default values c813ae79 (Wannes) 2013-03-23 15:28:20 +0100 116) \setkeys{adsphd}{info=true...
You want to copy an existing repository and go on working on it?
git clone https://location/of/the/repository git clone git@gitlab.mech.kuleuven.be:u0074517/git-overview.git //This presentation
git remote add name location //Add remote repository with location and name git remote add mech git@gitlab.mech.kuleuven.be:u0074517/git-overview.git
git push name branch //Push changes to remote git pull name branch //Pull changes from remote
Git documentation: git command --help
http://www.git-scm.com: Downloads, documentation, references, useful links...
https://try.github.io: Learn basics of git for free in 30' (interactive)
https://backlogtool.com/git-guide: Master the Git version control system
https://www.atlassian.com/git: Rather extended git tutorial
https://onlywei.github.io/explain-git-with-d3: Visualising git concepts
Got stuck? Just google it!
You can download this presentation from gitlab
https://gitlab.mech.kuleuven.be/u0074517/git-overview
Contact me for more info