0

How can I add an older version of a repository as a submodule to my github repo?

I'd like to use abraham/twitteroauth's older 0.5.0 version, which is compatible with php 5.3.

This just add the last version:

git submodule add <path>
git submodule init
git submodule update

which is not what I need.

neptune
  • 1,211
  • 2
  • 19
  • 32

1 Answers1

2

Go into the submodule, checkout 0.5.0, and commit.

git submodule add https://github.com/abraham/twitteroauth.git twitteroauth
cd twitteroauth
git checkout 0.5.0
git commit -a

The commit will show a change to twitteroauth recording the 0.5.0 commit it's now at.

diff --git a/twitteroauth b/twitteroauth
new file mode 160000
index 0000000..875918b
--- /dev/null
+++ b/twitteroauth
@@ -0,0 +1 @@
+Subproject commit 875918bad4f1e9651635ee3107f5edcce34b4acd
Schwern
  • 153,029
  • 25
  • 195
  • 336