oholimoli
oholimoli

Reputation: 113

Install Git in Pydroid 3 terminal

I'm using Pydroid3 and would like to use Git in the Pydroid Terminal.

In my Termux terminal I was able to install Git as described here: Python and Git on Android

The git command is now only recognized in the Termux Terminal but not in Pydroid :(. Installation of Git with apt-get in the Pydroid Terminal is not possible.

Has anybody managed to install Git for Pydroid?

Upvotes: 6

Views: 11192

Answers (2)

Igor Burenkov
Igor Burenkov

Reputation: 23

If you already have both Termux with git and Pydroid installed on your system, you can just make them use shared storage.

For example, you can set up Termux shared storage usage via termux-setup-storage command. It asks you to give the Termux app access to shared part of Android filesystem where folders like Downloads and DCIM reside and creates a link from within Termux $HOME folder to it. You can create a dedicated folder e.g. named "termux_workdir" there and clone or initialize repos into it using git via Termux terminal session.

Then you can save and edit files there via Pydroid "Save as" or "Open" options, for example, picking "termux_workdir" using Android Files app.

For more convenience, you can create a link to this folder from Termux $HOME (for example, cd without arguments and type ln -s ~/storage/shared/termux_workdir termux_workdir) and set Pydroid Terminal $HOME also to this folder (it will be /storage/emulated/0/termux_workdir in my example from Pydroid perspective), that can be made via "Terminal settings" menu.

Upvotes: 0

fuzzyTew
fuzzyTew

Reputation: 3778

This is working for me; you might need to tweak the curl or configure commands if things fail. I haven't looked into ssh for now, only https.

# enter dev folder
cd $HOME

# set a prefix variable for convenience
export PREFIX="$(readlink -f "$PKG_CONFIG_PATH"/../..)"

# if you want git-remote-https, first build and install curl
curl -LO https://curl.se/download/curl-7.77.0.tar.bz2
tar -jxvf curl-7.77.0.tar.bz2
cd curl-7.77.0
./configure --prefix="$PREFIX" --disable-static --with-openssl --with-ca-path=/system/etc/security/cacerts --with-ca-bundle="$SSL_CERT_FILE"
make -j8 install
cd ..

# download and enter git sources
curl -LO https://www.kernel.org/pub/software/scm/git/git-2.32.0.tar.gz
tar -zxvf git-2.32.0.tar.gz
cd git-2.32.0

# reconfigure git for platform
./configure --prefix="$PREFIX" --without-tcltk --disable-pthreads LDFLAGS="-lssl -lcrypto -lz"

# if you didn't install curl, download autoconf's install script since there is no coreutils on android
# curl "http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=blob_plain;f=build-aux/install-sh;hb=HEAD" -o install
# otherwise copy curl's install script in
cp ../curl-*/install-sh install

# build and install git
make -j8 install INSTALL="sh $(pwd)/install"

Upvotes: 0

Related Questions