SlideShare a Scribd company logo
1 of 11
Download to read offline
Getting started with gitsvn
Manij Shrestha
Who?
●

Git user who needs to work on project that uses SVN

●

SVN users who wants to learn Git

●

Because you can
Why?
●

Able to work on multiple branches from same project directory.

●

No need to be on VPN to pull the revision history.

●

Local branches, Stashing, local commits
How?
$ git svn clone svn://internal-repo/Project Project -s
(-s == Standard model, trunk, branches, tags)
OR

$ git svn clone svn://internal-repo/Project Project --trunk=trunk --branches=maintenance/* --prefix=git-svn/
prefix must trail with “/”

OR

$ git svn init svn://internal-repo/Project Project --trunk=trunk --branches=maintenance/* --prefix=git-svn/
$ git svn fetch
Taking a look @ .git/config
SVN

SVN:

GIT:
Pulling selective branch.
If you only want to pull few branches.
Edit “.git/config”
Add branch name(s), inside “{}”

$ git svn fetch

SVN
Getting Latest Code
$ git svn rebase
Not “git pull”
commit
$ git svn rebase (similar to ‘git pull’/ ‘svn update’, will rewind your changes and applies your changes on top)
$ git svn dcommit
SVN

Each “git commit” will be checked in as separate revision in SVN.
Working on branch
$ git checkout -b branch2 refs/remotes/git-svn/branch2

Don’t forget the refs/
You can now commit and dcommit on this branch

●

Merge is not recommended (Tree conflicts, commit to wrong branch). Merge branches in SVN.
Linear history
Always have a linear history.
SVN

GIT
LOST
Summary
git svn init
review .git/config
git svn fetch
git commit.. commit.. commit..
git svn rebase
git svn dcommit
git stash… git branch..
Linear History...

More Related Content

What's hot

Subversion to Git Migration
Subversion to Git MigrationSubversion to Git Migration
Subversion to Git MigrationTim Massey
 
Subversion in a distributed world
Subversion in a distributed worldSubversion in a distributed world
Subversion in a distributed worldLorna Mitchell
 
Working in Team using Git in Unity
Working in Team using Git in UnityWorking in Team using Git in Unity
Working in Team using Git in UnityRifauddin Tsalitsy
 
Training: Day Two - Eclipse, Git, Maven
Training: Day Two - Eclipse, Git, MavenTraining: Day Two - Eclipse, Git, Maven
Training: Day Two - Eclipse, Git, MavenArtur Ventura
 
Version Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an exampleVersion Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an exampleGaurav Kumar Garg
 
Git Workflow With Gitflow
Git Workflow With GitflowGit Workflow With Gitflow
Git Workflow With GitflowJosh Dvir
 
Git: A Getting Started Presentation
Git: A Getting Started PresentationGit: A Getting Started Presentation
Git: A Getting Started PresentationNap Ramirez
 
Collaborative development with Git | Workshop
Collaborative development with Git | WorkshopCollaborative development with Git | Workshop
Collaborative development with Git | WorkshopAnuchit Chalothorn
 
An introduction to Git and GitFlow
An introduction to Git and GitFlowAn introduction to Git and GitFlow
An introduction to Git and GitFlowMark Everard
 
Kubernetes Basic Operation
Kubernetes Basic OperationKubernetes Basic Operation
Kubernetes Basic OperationSimon Su
 

What's hot (20)

Subversion to Git Migration
Subversion to Git MigrationSubversion to Git Migration
Subversion to Git Migration
 
From SVN to Git
From SVN to GitFrom SVN to Git
From SVN to Git
 
Git in 5 Minutes
Git in 5 MinutesGit in 5 Minutes
Git in 5 Minutes
 
Subversion in a distributed world
Subversion in a distributed worldSubversion in a distributed world
Subversion in a distributed world
 
Working in Team using Git in Unity
Working in Team using Git in UnityWorking in Team using Git in Unity
Working in Team using Git in Unity
 
Training: Day Two - Eclipse, Git, Maven
Training: Day Two - Eclipse, Git, MavenTraining: Day Two - Eclipse, Git, Maven
Training: Day Two - Eclipse, Git, Maven
 
Version Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an exampleVersion Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an example
 
Subversion to Git Migration
Subversion to Git MigrationSubversion to Git Migration
Subversion to Git Migration
 
Git Workflow With Gitflow
Git Workflow With GitflowGit Workflow With Gitflow
Git Workflow With Gitflow
 
Git submodule
Git submoduleGit submodule
Git submodule
 
Git: A Getting Started Presentation
Git: A Getting Started PresentationGit: A Getting Started Presentation
Git: A Getting Started Presentation
 
What the Git? - WordCamp Atlanta
What the Git? - WordCamp AtlantaWhat the Git? - WordCamp Atlanta
What the Git? - WordCamp Atlanta
 
Fabric8 CI/CD
Fabric8 CI/CDFabric8 CI/CD
Fabric8 CI/CD
 
Git basics
Git basicsGit basics
Git basics
 
Git
GitGit
Git
 
Git
GitGit
Git
 
Collaborative development with Git | Workshop
Collaborative development with Git | WorkshopCollaborative development with Git | Workshop
Collaborative development with Git | Workshop
 
An introduction to Git and GitFlow
An introduction to Git and GitFlowAn introduction to Git and GitFlow
An introduction to Git and GitFlow
 
Git & gitflow
Git & gitflowGit & gitflow
Git & gitflow
 
Kubernetes Basic Operation
Kubernetes Basic OperationKubernetes Basic Operation
Kubernetes Basic Operation
 

Viewers also liked

Comparison of SVN and Git
Comparison of SVN and GitComparison of SVN and Git
Comparison of SVN and GitDaniel Wieth
 
Gitlab Training with GIT and SourceTree
Gitlab Training with GIT and SourceTreeGitlab Training with GIT and SourceTree
Gitlab Training with GIT and SourceTreeTeerapat Khunpech
 
Git vs SVN
Git vs SVNGit vs SVN
Git vs SVNneuros
 

Viewers also liked (6)

Git vs svn
Git vs svnGit vs svn
Git vs svn
 
Comparison of SVN and Git
Comparison of SVN and GitComparison of SVN and Git
Comparison of SVN and Git
 
GIT / SVN
GIT / SVNGIT / SVN
GIT / SVN
 
Gitlab Training with GIT and SourceTree
Gitlab Training with GIT and SourceTreeGitlab Training with GIT and SourceTree
Gitlab Training with GIT and SourceTree
 
Git vs SVN
Git vs SVNGit vs SVN
Git vs SVN
 
Git from SVN
Git from SVNGit from SVN
Git from SVN
 

Similar to Getting started with git svn

WRS GIT Branching Model - draft
WRS GIT Branching Model - draftWRS GIT Branching Model - draft
WRS GIT Branching Model - draftWalter Liu
 
Using Git as your VCS with Bioconductor
Using Git as your VCS with BioconductorUsing Git as your VCS with Bioconductor
Using Git as your VCS with Bioconductortimyates
 
Getting some Git
Getting some GitGetting some Git
Getting some GitBADR
 
Git and git workflow best practice
Git and git workflow best practiceGit and git workflow best practice
Git and git workflow best practiceMajid Hosseini
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An IntroductionBehzad Altaf
 
Transformative Git Practices
Transformative Git PracticesTransformative Git Practices
Transformative Git PracticesNicola Paolucci
 
Why Git Sucks and you'll use it anyways
Why Git Sucks and you'll use it anywaysWhy Git Sucks and you'll use it anyways
Why Git Sucks and you'll use it anywaysCarlos Taborda
 
Honestly Git Playground 20190221
Honestly Git Playground 20190221Honestly Git Playground 20190221
Honestly Git Playground 20190221Shinho Kang
 
Introduction of Git
Introduction of GitIntroduction of Git
Introduction of GitWayne Chen
 
Git and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern DeveloperGit and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern DeveloperJohn Stevenson
 
Git workflows presentation
Git workflows presentationGit workflows presentation
Git workflows presentationMack Hardy
 
Improving your workflow with git
Improving your workflow with gitImproving your workflow with git
Improving your workflow with gitDídac Ríos
 

Similar to Getting started with git svn (20)

Git
GitGit
Git
 
WRS GIT Branching Model - draft
WRS GIT Branching Model - draftWRS GIT Branching Model - draft
WRS GIT Branching Model - draft
 
Git
GitGit
Git
 
Git presentation
Git presentationGit presentation
Git presentation
 
Using Git as your VCS with Bioconductor
Using Git as your VCS with BioconductorUsing Git as your VCS with Bioconductor
Using Git as your VCS with Bioconductor
 
Git
GitGit
Git
 
Getting some Git
Getting some GitGetting some Git
Getting some Git
 
Git and git workflow best practice
Git and git workflow best practiceGit and git workflow best practice
Git and git workflow best practice
 
Git in a nutshell
Git in a nutshellGit in a nutshell
Git in a nutshell
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
 
Transformative Git Practices
Transformative Git PracticesTransformative Git Practices
Transformative Git Practices
 
Why Git Sucks and you'll use it anyways
Why Git Sucks and you'll use it anywaysWhy Git Sucks and you'll use it anyways
Why Git Sucks and you'll use it anyways
 
Honestly Git Playground 20190221
Honestly Git Playground 20190221Honestly Git Playground 20190221
Honestly Git Playground 20190221
 
Mastering GIT
Mastering GITMastering GIT
Mastering GIT
 
Introduction of Git
Introduction of GitIntroduction of Git
Introduction of Git
 
Git Tech Talk
Git  Tech TalkGit  Tech Talk
Git Tech Talk
 
Basic git
Basic gitBasic git
Basic git
 
Git and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern DeveloperGit and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern Developer
 
Git workflows presentation
Git workflows presentationGit workflows presentation
Git workflows presentation
 
Improving your workflow with git
Improving your workflow with gitImproving your workflow with git
Improving your workflow with git
 

Recently uploaded

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 

Recently uploaded (20)

E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 

Getting started with git svn

  • 1. Getting started with gitsvn Manij Shrestha
  • 2. Who? ● Git user who needs to work on project that uses SVN ● SVN users who wants to learn Git ● Because you can
  • 3. Why? ● Able to work on multiple branches from same project directory. ● No need to be on VPN to pull the revision history. ● Local branches, Stashing, local commits
  • 4. How? $ git svn clone svn://internal-repo/Project Project -s (-s == Standard model, trunk, branches, tags) OR $ git svn clone svn://internal-repo/Project Project --trunk=trunk --branches=maintenance/* --prefix=git-svn/ prefix must trail with “/” OR $ git svn init svn://internal-repo/Project Project --trunk=trunk --branches=maintenance/* --prefix=git-svn/ $ git svn fetch
  • 5. Taking a look @ .git/config SVN SVN: GIT:
  • 6. Pulling selective branch. If you only want to pull few branches. Edit “.git/config” Add branch name(s), inside “{}” $ git svn fetch SVN
  • 7. Getting Latest Code $ git svn rebase Not “git pull”
  • 8. commit $ git svn rebase (similar to ‘git pull’/ ‘svn update’, will rewind your changes and applies your changes on top) $ git svn dcommit SVN Each “git commit” will be checked in as separate revision in SVN.
  • 9. Working on branch $ git checkout -b branch2 refs/remotes/git-svn/branch2 Don’t forget the refs/ You can now commit and dcommit on this branch ● Merge is not recommended (Tree conflicts, commit to wrong branch). Merge branches in SVN.
  • 10. Linear history Always have a linear history. SVN GIT LOST
  • 11. Summary git svn init review .git/config git svn fetch git commit.. commit.. commit.. git svn rebase git svn dcommit git stash… git branch.. Linear History...