LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > sag47
User Name
Password

Notices


Old

Cloning a git repository in an idempotent way

Posted 05-20-2015 at 02:08 AM by sag47
Updated 05-20-2015 at 02:25 AM by sag47

In config management, it is best to do setup in an idempotent way. After some basic research here's a way to clone a repository in an idempotent way. In this example we'll be cloning my home repository into ${HOME}/git/home.

First, check to see if the repository directory exists. Then change the working directory to it.

Code:
#variables
repo="https://github.com/samrocketman/home.git"
local_repo_location="${HOME}/git/home"
...
Senior Member
Posted in Uncategorized
Views 6491 Comments 2 sag47 is offline

  



All times are GMT -5. The time now is 07:33 AM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration