GithubHelp home page GithubHelp logo

timothylopas / example-use-git-submodule-for-shared-code Goto Github PK

View Code? Open in Web Editor NEW

This project forked from robocorp/example-use-git-submodule-for-shared-code

0.0 0.0 0.0 11 KB

RobotFramework 100.00%

example-use-git-submodule-for-shared-code's Introduction

Use Git submodule for shared robot code

This example robot code repository includes another robot repository (https://github.com/robocorp/example-shared-robot-framework-keywords-and-libraries) as a Git submodule.

The included repository contains (fictional) common shared code used by many robot projects. Instead of copying & pasting the code into each robot project that needs it, isolating and sharing the common code between the robots might make sense!

This project was created using RCC and the standard Robot Framework template.

The robot includes the shared robot code from the other repository as a Git submodule. The submodule is stored in the shared directory.

The shared Git submodule in this project was created with the git submodule add command:

git submodule add https://github.com/robocorp/example-shared-robot-framework-keywords-and-libraries shared

The .gitmodules file defines the path and the URL to the included repository:

[submodule "shared"]
	path = shared
	url = https://github.com/robocorp/example-shared-robot-framework-keywords-and-libraries

See the tasks.robot file for examples of importing and using the shared code.

How to clone this project, including the Git submodule?

To test and clone this project, including the Git submodule, you can use the following command:

git clone --recurse-submodules [email protected]:robocorp/example-use-git-submodule-for-shared-code.git

The --recurse-submodules option handles cloning the submodule. See the Git submodule documentation for more information.

How to pull the upstream changes to the submodule?

To pull the upstream changes to the submodule, use the following command:

git submodule update --remote

Notes

The Git submodule strategy works for code-sharing, but there are some caveats. Control Room does not automatically clone the submodules at the time of writing, and there is no way to run manual cloning commands in Control Room.

If you use Git submodules, you can still upload your robot to Control Room using the upload functionality in Robocorp Lab, VS Code, or RCC. Since the upload creates a zip package with the project contents, the zip also contains the submodules!

example-use-git-submodule-for-shared-code's People

Contributors

janipalsamaki avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.