SlideShare a Scribd company logo
Git for Excel
Felix Zumstein, 23 September 2019
xlwings Meetup London
Agenda (1/2)
2
1. But why??
2. Git refresher
3. So what’s the issue?
4. Four golden rules
Agenda (2/2)
3
5. Tools
A. Spreadsheet Compare
B. xltrail
C. Git XL
D. Git LFS
E. Git clients
6. Merge conflicts
A. Single branch workflow: File locking
B. Multi branch workflow
About us
Innovative Solutions
for Microsoft Excel
A small team with a big mission
5
xlwings
6
• Python for Excel
• Scripts, UDFs,
Macros, REST API
• Windows & Mac
(except UDFs)
• Free & open-source
• New: Professional
support plans
xltrail
7
• Version control for Excel
• Tracks formulas and VBA code
• Local Git extension that makes git diff
and git merge work with VBA code (only)
• Free & open-source
Git XL
8
xlwings CI
9
Continuous integration for Excel files
• Write unit tests for Excel files with xlwings
• Run them automatically on the server after
pushing changes to your Git repo
Example: Gitlab Pipeline
xlwings-reports (coming soon)
10
Template Report
create_report()
1. But why??
Look familiar?
12
A few more reasons
13
• Excel files are code, so treat them as such
• Git is battle tested
• Collaboration
• Audit trail / Spreadsheet governance
• Peer review / Approval process
• Reduce errors
2. Git refresher
The most important commands
15
• git diff
• git add Book1.xlsm
• git commit –m ”changed some things”
• git push origin master
• git pull
3. So what’s the issue?
1) Git doesn’t understand Excel
17
2) GitHub doesn’t understand Excel
18
and GitLab/BitBucket/Azure DevOps are no better
3) Heavy Excel files
19
• Git transfers the entire commit history of the
repository during the cloning process.
• As an example: Committing a 25 MB workbook
once per day during weekdays will lead to 7 GB
repo at the end of the year
4) Merge conflicts
20
Compared to text files, merge
conflicts with Excel files:
• Happen way more often
• Are harder to resolve
4. Four golden rules
1) No more versioned file names!
22
Financial Model_v1.xlsb
Financial Model.xlsb
2) Make use of commit messages
23
3) Add temp files to .gitignore
24
The .gitignore file prevents certain files to be accidentally
added/pushed to Git. To filter out temporary Excel files,
add this to your .gitignore file:
~$*.xl*
Otherwise you’ll end up
sooner or later like this:
4) Release a version via “git tag”
25
Release
asset/artefact
(not part of
Git repo!!)
It’s OK to include version stamps in released files (this
can be automated via a continuous integration service
like the new GitHub actions).
5. Tools
A. Spreadsheet Compare
Spreadsheet Compare
28
• Compares 2 Excel files
• Standalone desktop app (also integrated into
the Inquire Excel add-in)
• Part of Office Professional Plus and Office 365
ProPlus
• You can integrate it with Git:
https://www.xltrail.com/blog/git-diff-spreadsheetcompare
Sheet comparison
29
VBA comparison
30
B. xltrail
xltrail
32
• Free trial: https://www.xltrail.com
• xltrail syncs with any Git provider
• Alternatively, it works via Drag and Drop
and manages Git behind the scenes
• Allows comparisons across branches,
between any two versions
Summary across sheets and VBA
33
Sheet in context
34
C. Git XL
Git XL
36
• https://www.xltrail.com/git-xl
• Free & open-source local Git extension
• Created & maintained by us
• It is able to diff & merge (!) VBA code
• Windows only at the moment
Git XL: via command line
37
Git XL: via Sourcetree
38
Zero configuration required!
Git XL: VBA merging
39
• Git XL merges VBA directly in the VBA Editor
• Conflicts get highlighted like this:
D. Git LFS (Large File Storage)
Git LFS intro
41
• https://git-lfs.github.com
• Free & open-source local Git extension
• Large files are downloaded during “git checkout”
rather than during “git clone/git fetch”
• On the server side, you need to make sure that it
is supported & enabled
• git lfs track "*.xl*"
• Side note: Since Git 2.18 (June 2018), there’s an
“emerging feature” built into Git directly that is called
“partial clone”: https://git-scm.com/docs/partial-clone
Git LFS in action
42
• All standard Git commands like git pull/push work
automatically with LFS behind the scene
E. Git clients
Git clients
44
Git offers various clients to interact with the remote:
• Command Line
• Desktop clients (e.g. GitHub Desktop, Sourcetree).
For an overview: https://git-scm.com/downloads/guis
• File explorer integration: https://tortoisegit.org
• Integration with IDE/Text Editor (e.g. VSCode)
• Drag and Drop directly on GitHub, GitLab, Azure
DevOps (but not Bitbucket)
6. Merge conflicts
Merge conflicts will bite you!
46
They also happen:
• with a single master branch
• with a single user
For example:
• You commit during the day at work. In the
evening, you continue at home and forget to
pull before you make a new commit.
How do merge conflicts happen
47
True
merges
always
cause a
merge
conflict
(with
Excel
Files)
Fast-forward
merges
never
cause a
merge
conflict
A. Single branch workflow:
File locking
Informal file locking
49
• Similar to shared drives or SharePoint
• This prevents the merge conflict altogether
• Easy solution:
@team I am going to
update Model.xlsm
Let me know when you’re
done, I need it for 5 min.
All yours.
Thanks, let me pull.
Git LFS file locking
50
• Git LFS offers file locking (introduced
with v2.0)
• Meanwhile, all major providers support it
• A caveat of the file locking is that you
need to remember two things:
–Actually lock the file
–Start with a “git pull” before you edit the file
• git lfs track "*.xl*" --lockable
Git LFS file locking: commands
51
User: fzumstein
User: jenny
B. Multi branch workflow
Merge two branches
53
• We want to merge ”mybranch” into
“master”
• We end up in a merge conflict:
git mergetool to the rescue
54
• A simple way to get the files from both
branches next to each other is via “git
mergetool” – then cancel with Ctrl-C.
• This will add 4 files:
master mybranch
Resolve the merge conflict
55
• Now compare “contact_list.xlsm” (master)
with “contact_list_REMOTE.xlsm” (mybranch)
• Spreadsheet Compare or xltrail will be helpful
with that
• Manually apply the changes you want from
mybranch in your master version
• Then resolve the merge conflict via “git add”
and “git commit”.
Thank You
Let’s connect:
https://www.linkedin.com/in/felix-zumstein
More material:
https://www.xltrail.com/blog

More Related Content

What's hot

Java Performance Analysis on Linux with Flame Graphs
Java Performance Analysis on Linux with Flame GraphsJava Performance Analysis on Linux with Flame Graphs
Java Performance Analysis on Linux with Flame Graphs
Brendan Gregg
 
HTTP/2の現状とこれから
HTTP/2の現状とこれからHTTP/2の現状とこれから
HTTP/2の現状とこれから
shigeki_ohtsu
 
Git入門
Git入門Git入門
Git入門
小川 昌吾
 
初心者 Git 上手攻略
初心者 Git 上手攻略初心者 Git 上手攻略
初心者 Git 上手攻略
Lucien Lee
 
Spring Data RESTを利用したAPIの設計と、作り直しまでの道のり
Spring Data RESTを利用したAPIの設計と、作り直しまでの道のり Spring Data RESTを利用したAPIの設計と、作り直しまでの道のり
Spring Data RESTを利用したAPIの設計と、作り直しまでの道のり
Rakuten Group, Inc.
 
The Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageThe Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast Storage
Kernel TLV
 
Performance Profiling in Rust
Performance Profiling in RustPerformance Profiling in Rust
Performance Profiling in Rust
InfluxData
 
社内Git勉強会向け資料
社内Git勉強会向け資料社内Git勉強会向け資料
社内Git勉強会向け資料
Hiroki Saiki
 
新人Git/Github研修公開用スライド(その1)
新人Git/Github研修公開用スライド(その1)新人Git/Github研修公開用スライド(その1)
新人Git/Github研修公開用スライド(その1)
pupupopo88
 
Making Cassandra more capable, faster, and more reliable (at ApacheCon@Home 2...
Making Cassandra more capable, faster, and more reliable (at ApacheCon@Home 2...Making Cassandra more capable, faster, and more reliable (at ApacheCon@Home 2...
Making Cassandra more capable, faster, and more reliable (at ApacheCon@Home 2...
Scalar, Inc.
 
実践 Git - 低レベルに知る Git
実践 Git - 低レベルに知る Git実践 Git - 低レベルに知る Git
実践 Git - 低レベルに知る Git
Youhei Nitta
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
Lee Hanxue
 
MySQLレプリケーションあれやこれや
MySQLレプリケーションあれやこれやMySQLレプリケーションあれやこれや
MySQLレプリケーションあれやこれや
yoku0825
 
『例えば、PHPを避ける』以降PHPはどれだけ安全になったか
『例えば、PHPを避ける』以降PHPはどれだけ安全になったか『例えば、PHPを避ける』以降PHPはどれだけ安全になったか
『例えば、PHPを避ける』以降PHPはどれだけ安全になったか
Hiroshi Tokumaru
 
Java 18で入ったJVM関連の(やや細かめな)改善(JJUGナイトセミナー「Java 18 リリース記念イベント」発表資料)
Java 18で入ったJVM関連の(やや細かめな)改善(JJUGナイトセミナー「Java 18 リリース記念イベント」発表資料)Java 18で入ったJVM関連の(やや細かめな)改善(JJUGナイトセミナー「Java 18 リリース記念イベント」発表資料)
Java 18で入ったJVM関連の(やや細かめな)改善(JJUGナイトセミナー「Java 18 リリース記念イベント」発表資料)
NTT DATA Technology & Innovation
 
CircleCIのinfrastructureを支えるTerraformのCI/CDパイプラインの改善
CircleCIのinfrastructureを支えるTerraformのCI/CDパイプラインの改善CircleCIのinfrastructureを支えるTerraformのCI/CDパイプラインの改善
CircleCIのinfrastructureを支えるTerraformのCI/CDパイプラインの改善
Ito Takayuki
 
Parallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDBParallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDB
Mydbops
 
Apache Kafkaって本当に大丈夫?~故障検証のオーバービューと興味深い挙動の紹介~
Apache Kafkaって本当に大丈夫?~故障検証のオーバービューと興味深い挙動の紹介~Apache Kafkaって本当に大丈夫?~故障検証のオーバービューと興味深い挙動の紹介~
Apache Kafkaって本当に大丈夫?~故障検証のオーバービューと興味深い挙動の紹介~
NTT DATA OSS Professional Services
 

What's hot (20)

Java Performance Analysis on Linux with Flame Graphs
Java Performance Analysis on Linux with Flame GraphsJava Performance Analysis on Linux with Flame Graphs
Java Performance Analysis on Linux with Flame Graphs
 
HTTP/2の現状とこれから
HTTP/2の現状とこれからHTTP/2の現状とこれから
HTTP/2の現状とこれから
 
Git入門
Git入門Git入門
Git入門
 
初心者 Git 上手攻略
初心者 Git 上手攻略初心者 Git 上手攻略
初心者 Git 上手攻略
 
Git Tutorial 教學
Git Tutorial 教學Git Tutorial 教學
Git Tutorial 教學
 
Spring Data RESTを利用したAPIの設計と、作り直しまでの道のり
Spring Data RESTを利用したAPIの設計と、作り直しまでの道のり Spring Data RESTを利用したAPIの設計と、作り直しまでの道のり
Spring Data RESTを利用したAPIの設計と、作り直しまでの道のり
 
The Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageThe Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast Storage
 
Performance Profiling in Rust
Performance Profiling in RustPerformance Profiling in Rust
Performance Profiling in Rust
 
社内Git勉強会向け資料
社内Git勉強会向け資料社内Git勉強会向け資料
社内Git勉強会向け資料
 
新人Git/Github研修公開用スライド(その1)
新人Git/Github研修公開用スライド(その1)新人Git/Github研修公開用スライド(その1)
新人Git/Github研修公開用スライド(その1)
 
Making Cassandra more capable, faster, and more reliable (at ApacheCon@Home 2...
Making Cassandra more capable, faster, and more reliable (at ApacheCon@Home 2...Making Cassandra more capable, faster, and more reliable (at ApacheCon@Home 2...
Making Cassandra more capable, faster, and more reliable (at ApacheCon@Home 2...
 
実践 Git - 低レベルに知る Git
実践 Git - 低レベルに知る Git実践 Git - 低レベルに知る Git
実践 Git - 低レベルに知る Git
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
 
SSH力をつけよう
SSH力をつけようSSH力をつけよう
SSH力をつけよう
 
MySQLレプリケーションあれやこれや
MySQLレプリケーションあれやこれやMySQLレプリケーションあれやこれや
MySQLレプリケーションあれやこれや
 
『例えば、PHPを避ける』以降PHPはどれだけ安全になったか
『例えば、PHPを避ける』以降PHPはどれだけ安全になったか『例えば、PHPを避ける』以降PHPはどれだけ安全になったか
『例えば、PHPを避ける』以降PHPはどれだけ安全になったか
 
Java 18で入ったJVM関連の(やや細かめな)改善(JJUGナイトセミナー「Java 18 リリース記念イベント」発表資料)
Java 18で入ったJVM関連の(やや細かめな)改善(JJUGナイトセミナー「Java 18 リリース記念イベント」発表資料)Java 18で入ったJVM関連の(やや細かめな)改善(JJUGナイトセミナー「Java 18 リリース記念イベント」発表資料)
Java 18で入ったJVM関連の(やや細かめな)改善(JJUGナイトセミナー「Java 18 リリース記念イベント」発表資料)
 
CircleCIのinfrastructureを支えるTerraformのCI/CDパイプラインの改善
CircleCIのinfrastructureを支えるTerraformのCI/CDパイプラインの改善CircleCIのinfrastructureを支えるTerraformのCI/CDパイプラインの改善
CircleCIのinfrastructureを支えるTerraformのCI/CDパイプラインの改善
 
Parallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDBParallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDB
 
Apache Kafkaって本当に大丈夫?~故障検証のオーバービューと興味深い挙動の紹介~
Apache Kafkaって本当に大丈夫?~故障検証のオーバービューと興味深い挙動の紹介~Apache Kafkaって本当に大丈夫?~故障検証のオーバービューと興味深い挙動の紹介~
Apache Kafkaって本当に大丈夫?~故障検証のオーバービューと興味深い挙動の紹介~
 

Similar to Git for Excel

Git for Excel (Webinar)
Git for Excel (Webinar)Git for Excel (Webinar)
Git for Excel (Webinar)
xlwings
 
Git for Excel files webinar
Git for Excel files webinarGit for Excel files webinar
Git for Excel files webinar
xlwings
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
Venkat Malladi
 
[2015/2016] Collaborative software development with Git
[2015/2016] Collaborative software development with Git[2015/2016] Collaborative software development with Git
[2015/2016] Collaborative software development with Git
Ivano Malavolta
 
Git
GitGit
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hub
Naveen Pandey
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
Betclic Everest Group Tech Team
 
Git for folk who like GUIs
Git for folk who like GUIsGit for folk who like GUIs
Git for folk who like GUIs
Tim Osborn
 
Git for developers
Git for developersGit for developers
Git for developers
Hacen Dadda
 
GitHub Workflows for Technical Communication
GitHub Workflows for Technical CommunicationGitHub Workflows for Technical Communication
GitHub Workflows for Technical Communication
STC-Philadelphia Metro Chapter
 
Introduction to Git for Network Engineers
Introduction to Git for Network EngineersIntroduction to Git for Network Engineers
Introduction to Git for Network Engineers
Joel W. King
 
Git Session 2K23.pptx
Git Session 2K23.pptxGit Session 2K23.pptx
Git Session 2K23.pptx
Eshaan35
 
Git overview
Git overviewGit overview
Git overview
Gowarthini
 
Git and github
Git and githubGit and github
Git and github
Sayantika Banik
 
Git
GitGit
Git hub for designers
Git hub for designersGit hub for designers
Git hub for designers
FITC
 
git and github-1.pptx
git and github-1.pptxgit and github-1.pptx
git and github-1.pptx
tnscharishma
 
CSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GITCSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GIT
PouriaQashqai1
 
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Ahmed El-Arabawy
 

Similar to Git for Excel (20)

Git for Excel (Webinar)
Git for Excel (Webinar)Git for Excel (Webinar)
Git for Excel (Webinar)
 
Git for Excel files webinar
Git for Excel files webinarGit for Excel files webinar
Git for Excel files webinar
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
 
[2015/2016] Collaborative software development with Git
[2015/2016] Collaborative software development with Git[2015/2016] Collaborative software development with Git
[2015/2016] Collaborative software development with Git
 
Git
GitGit
Git
 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hub
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
 
Git for folk who like GUIs
Git for folk who like GUIsGit for folk who like GUIs
Git for folk who like GUIs
 
Git for developers
Git for developersGit for developers
Git for developers
 
GitHub Workflows for Technical Communication
GitHub Workflows for Technical CommunicationGitHub Workflows for Technical Communication
GitHub Workflows for Technical Communication
 
Introduction to Git for Network Engineers
Introduction to Git for Network EngineersIntroduction to Git for Network Engineers
Introduction to Git for Network Engineers
 
GitWorkFlow
GitWorkFlowGitWorkFlow
GitWorkFlow
 
Git Session 2K23.pptx
Git Session 2K23.pptxGit Session 2K23.pptx
Git Session 2K23.pptx
 
Git overview
Git overviewGit overview
Git overview
 
Git and github
Git and githubGit and github
Git and github
 
Git
GitGit
Git
 
Git hub for designers
Git hub for designersGit hub for designers
Git hub for designers
 
git and github-1.pptx
git and github-1.pptxgit and github-1.pptx
git and github-1.pptx
 
CSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GITCSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GIT
 
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
 

More from xlwings

xlwings for Google Sheets
xlwings for Google Sheetsxlwings for Google Sheets
xlwings for Google Sheets
xlwings
 
Cross-platform Spreadsheet Automation with Python
Cross-platform Spreadsheet Automation with PythonCross-platform Spreadsheet Automation with Python
Cross-platform Spreadsheet Automation with Python
xlwings
 
Automate your PDF factsheets with xlwings Reports
Automate your PDF factsheets with xlwings ReportsAutomate your PDF factsheets with xlwings Reports
Automate your PDF factsheets with xlwings Reports
xlwings
 
Tech3camp Meetup: Python for Excel
Tech3camp Meetup: Python for ExcelTech3camp Meetup: Python for Excel
Tech3camp Meetup: Python for Excel
xlwings
 
xlwings performance
xlwings performancexlwings performance
xlwings performance
xlwings
 
Deployment of xlwings-powered spreadsheets (webinar)
Deployment of xlwings-powered spreadsheets (webinar)Deployment of xlwings-powered spreadsheets (webinar)
Deployment of xlwings-powered spreadsheets (webinar)
xlwings
 
xlwings reports: Reporting with Excel & Python
xlwings reports: Reporting with Excel & Pythonxlwings reports: Reporting with Excel & Python
xlwings reports: Reporting with Excel & Python
xlwings
 
Python and Excel in Finance (PyData meetup Zurich)
Python and Excel in Finance (PyData meetup Zurich)Python and Excel in Finance (PyData meetup Zurich)
Python and Excel in Finance (PyData meetup Zurich)
xlwings
 
Automated testing of Excel Workbooks
Automated testing of Excel WorkbooksAutomated testing of Excel Workbooks
Automated testing of Excel Workbooks
xlwings
 
Automated Testing of Excel Workbooks
Automated Testing of Excel WorkbooksAutomated Testing of Excel Workbooks
Automated Testing of Excel Workbooks
xlwings
 
xlwings Presentation (Excel & Python) Swiss FinteCH event
xlwings Presentation (Excel & Python) Swiss FinteCH eventxlwings Presentation (Excel & Python) Swiss FinteCH event
xlwings Presentation (Excel & Python) Swiss FinteCH event
xlwings
 
Python. Finance. Excel. - The Thalesians
Python. Finance. Excel. - The ThalesiansPython. Finance. Excel. - The Thalesians
Python. Finance. Excel. - The Thalesians
xlwings
 
For Python Quants Conference NYC 6th May 2016
For Python Quants Conference NYC 6th May 2016For Python Quants Conference NYC 6th May 2016
For Python Quants Conference NYC 6th May 2016
xlwings
 
Open Source in Quant Finance - xlwings
Open Source in Quant Finance - xlwingsOpen Source in Quant Finance - xlwings
Open Source in Quant Finance - xlwingsxlwings
 
Odsc presentation
Odsc presentationOdsc presentation
Odsc presentation
xlwings
 
xlwings - For Python Quants Conference (London 2014)
xlwings - For Python Quants Conference (London 2014)xlwings - For Python Quants Conference (London 2014)
xlwings - For Python Quants Conference (London 2014)
xlwings
 
xlwings Zurich Python User Group Meetup
xlwings Zurich Python User Group Meetupxlwings Zurich Python User Group Meetup
xlwings Zurich Python User Group Meetup
xlwings
 
xlwings - Connecting Python with Excel
xlwings - Connecting Python with Excelxlwings - Connecting Python with Excel
xlwings - Connecting Python with Excel
xlwings
 

More from xlwings (18)

xlwings for Google Sheets
xlwings for Google Sheetsxlwings for Google Sheets
xlwings for Google Sheets
 
Cross-platform Spreadsheet Automation with Python
Cross-platform Spreadsheet Automation with PythonCross-platform Spreadsheet Automation with Python
Cross-platform Spreadsheet Automation with Python
 
Automate your PDF factsheets with xlwings Reports
Automate your PDF factsheets with xlwings ReportsAutomate your PDF factsheets with xlwings Reports
Automate your PDF factsheets with xlwings Reports
 
Tech3camp Meetup: Python for Excel
Tech3camp Meetup: Python for ExcelTech3camp Meetup: Python for Excel
Tech3camp Meetup: Python for Excel
 
xlwings performance
xlwings performancexlwings performance
xlwings performance
 
Deployment of xlwings-powered spreadsheets (webinar)
Deployment of xlwings-powered spreadsheets (webinar)Deployment of xlwings-powered spreadsheets (webinar)
Deployment of xlwings-powered spreadsheets (webinar)
 
xlwings reports: Reporting with Excel & Python
xlwings reports: Reporting with Excel & Pythonxlwings reports: Reporting with Excel & Python
xlwings reports: Reporting with Excel & Python
 
Python and Excel in Finance (PyData meetup Zurich)
Python and Excel in Finance (PyData meetup Zurich)Python and Excel in Finance (PyData meetup Zurich)
Python and Excel in Finance (PyData meetup Zurich)
 
Automated testing of Excel Workbooks
Automated testing of Excel WorkbooksAutomated testing of Excel Workbooks
Automated testing of Excel Workbooks
 
Automated Testing of Excel Workbooks
Automated Testing of Excel WorkbooksAutomated Testing of Excel Workbooks
Automated Testing of Excel Workbooks
 
xlwings Presentation (Excel & Python) Swiss FinteCH event
xlwings Presentation (Excel & Python) Swiss FinteCH eventxlwings Presentation (Excel & Python) Swiss FinteCH event
xlwings Presentation (Excel & Python) Swiss FinteCH event
 
Python. Finance. Excel. - The Thalesians
Python. Finance. Excel. - The ThalesiansPython. Finance. Excel. - The Thalesians
Python. Finance. Excel. - The Thalesians
 
For Python Quants Conference NYC 6th May 2016
For Python Quants Conference NYC 6th May 2016For Python Quants Conference NYC 6th May 2016
For Python Quants Conference NYC 6th May 2016
 
Open Source in Quant Finance - xlwings
Open Source in Quant Finance - xlwingsOpen Source in Quant Finance - xlwings
Open Source in Quant Finance - xlwings
 
Odsc presentation
Odsc presentationOdsc presentation
Odsc presentation
 
xlwings - For Python Quants Conference (London 2014)
xlwings - For Python Quants Conference (London 2014)xlwings - For Python Quants Conference (London 2014)
xlwings - For Python Quants Conference (London 2014)
 
xlwings Zurich Python User Group Meetup
xlwings Zurich Python User Group Meetupxlwings Zurich Python User Group Meetup
xlwings Zurich Python User Group Meetup
 
xlwings - Connecting Python with Excel
xlwings - Connecting Python with Excelxlwings - Connecting Python with Excel
xlwings - Connecting Python with Excel
 

Recently uploaded

Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
e20449
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
Pro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp BookPro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp Book
abdulrafaychaudhry
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
ShamsuddeenMuhammadA
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 

Recently uploaded (20)

Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
Pro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp BookPro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp Book
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 

Git for Excel

  • 1. Git for Excel Felix Zumstein, 23 September 2019 xlwings Meetup London
  • 2. Agenda (1/2) 2 1. But why?? 2. Git refresher 3. So what’s the issue? 4. Four golden rules
  • 3. Agenda (2/2) 3 5. Tools A. Spreadsheet Compare B. xltrail C. Git XL D. Git LFS E. Git clients 6. Merge conflicts A. Single branch workflow: File locking B. Multi branch workflow
  • 5. Innovative Solutions for Microsoft Excel A small team with a big mission 5
  • 6. xlwings 6 • Python for Excel • Scripts, UDFs, Macros, REST API • Windows & Mac (except UDFs) • Free & open-source • New: Professional support plans
  • 7. xltrail 7 • Version control for Excel • Tracks formulas and VBA code
  • 8. • Local Git extension that makes git diff and git merge work with VBA code (only) • Free & open-source Git XL 8
  • 9. xlwings CI 9 Continuous integration for Excel files • Write unit tests for Excel files with xlwings • Run them automatically on the server after pushing changes to your Git repo Example: Gitlab Pipeline
  • 13. A few more reasons 13 • Excel files are code, so treat them as such • Git is battle tested • Collaboration • Audit trail / Spreadsheet governance • Peer review / Approval process • Reduce errors
  • 15. The most important commands 15 • git diff • git add Book1.xlsm • git commit –m ”changed some things” • git push origin master • git pull
  • 16. 3. So what’s the issue?
  • 17. 1) Git doesn’t understand Excel 17
  • 18. 2) GitHub doesn’t understand Excel 18 and GitLab/BitBucket/Azure DevOps are no better
  • 19. 3) Heavy Excel files 19 • Git transfers the entire commit history of the repository during the cloning process. • As an example: Committing a 25 MB workbook once per day during weekdays will lead to 7 GB repo at the end of the year
  • 20. 4) Merge conflicts 20 Compared to text files, merge conflicts with Excel files: • Happen way more often • Are harder to resolve
  • 21. 4. Four golden rules
  • 22. 1) No more versioned file names! 22 Financial Model_v1.xlsb Financial Model.xlsb
  • 23. 2) Make use of commit messages 23
  • 24. 3) Add temp files to .gitignore 24 The .gitignore file prevents certain files to be accidentally added/pushed to Git. To filter out temporary Excel files, add this to your .gitignore file: ~$*.xl* Otherwise you’ll end up sooner or later like this:
  • 25. 4) Release a version via “git tag” 25 Release asset/artefact (not part of Git repo!!) It’s OK to include version stamps in released files (this can be automated via a continuous integration service like the new GitHub actions).
  • 28. Spreadsheet Compare 28 • Compares 2 Excel files • Standalone desktop app (also integrated into the Inquire Excel add-in) • Part of Office Professional Plus and Office 365 ProPlus • You can integrate it with Git: https://www.xltrail.com/blog/git-diff-spreadsheetcompare
  • 32. xltrail 32 • Free trial: https://www.xltrail.com • xltrail syncs with any Git provider • Alternatively, it works via Drag and Drop and manages Git behind the scenes • Allows comparisons across branches, between any two versions
  • 33. Summary across sheets and VBA 33
  • 36. Git XL 36 • https://www.xltrail.com/git-xl • Free & open-source local Git extension • Created & maintained by us • It is able to diff & merge (!) VBA code • Windows only at the moment
  • 37. Git XL: via command line 37
  • 38. Git XL: via Sourcetree 38 Zero configuration required!
  • 39. Git XL: VBA merging 39 • Git XL merges VBA directly in the VBA Editor • Conflicts get highlighted like this:
  • 40. D. Git LFS (Large File Storage)
  • 41. Git LFS intro 41 • https://git-lfs.github.com • Free & open-source local Git extension • Large files are downloaded during “git checkout” rather than during “git clone/git fetch” • On the server side, you need to make sure that it is supported & enabled • git lfs track "*.xl*" • Side note: Since Git 2.18 (June 2018), there’s an “emerging feature” built into Git directly that is called “partial clone”: https://git-scm.com/docs/partial-clone
  • 42. Git LFS in action 42 • All standard Git commands like git pull/push work automatically with LFS behind the scene
  • 44. Git clients 44 Git offers various clients to interact with the remote: • Command Line • Desktop clients (e.g. GitHub Desktop, Sourcetree). For an overview: https://git-scm.com/downloads/guis • File explorer integration: https://tortoisegit.org • Integration with IDE/Text Editor (e.g. VSCode) • Drag and Drop directly on GitHub, GitLab, Azure DevOps (but not Bitbucket)
  • 46. Merge conflicts will bite you! 46 They also happen: • with a single master branch • with a single user For example: • You commit during the day at work. In the evening, you continue at home and forget to pull before you make a new commit.
  • 47. How do merge conflicts happen 47 True merges always cause a merge conflict (with Excel Files) Fast-forward merges never cause a merge conflict
  • 48. A. Single branch workflow: File locking
  • 49. Informal file locking 49 • Similar to shared drives or SharePoint • This prevents the merge conflict altogether • Easy solution: @team I am going to update Model.xlsm Let me know when you’re done, I need it for 5 min. All yours. Thanks, let me pull.
  • 50. Git LFS file locking 50 • Git LFS offers file locking (introduced with v2.0) • Meanwhile, all major providers support it • A caveat of the file locking is that you need to remember two things: –Actually lock the file –Start with a “git pull” before you edit the file • git lfs track "*.xl*" --lockable
  • 51. Git LFS file locking: commands 51 User: fzumstein User: jenny
  • 52. B. Multi branch workflow
  • 53. Merge two branches 53 • We want to merge ”mybranch” into “master” • We end up in a merge conflict:
  • 54. git mergetool to the rescue 54 • A simple way to get the files from both branches next to each other is via “git mergetool” – then cancel with Ctrl-C. • This will add 4 files: master mybranch
  • 55. Resolve the merge conflict 55 • Now compare “contact_list.xlsm” (master) with “contact_list_REMOTE.xlsm” (mybranch) • Spreadsheet Compare or xltrail will be helpful with that • Manually apply the changes you want from mybranch in your master version • Then resolve the merge conflict via “git add” and “git commit”.