Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use git without installing?

I have heard good things about git and I would like to try it out before installing it. This would also be great to put it on a flash drive if I wanted to use git at school. Is it possible to use the full path like /path/to/git init?

I primarily use Mac OS X so the question is mostly directed for Mac, but I would also like to know if it is possible on other OS's as well.

EDIT:

Compiling from source works. I used the following commands:

cd git-1.7.5.1 #this is the decompressed dir containing src
make configure
./configure --prefix=/path/to/install/git
make all
sudo make install

The downside to this method is that once compiled, the directory is a hefty 200MB. That is why I chose jgit as the answer. jgit.sh is less than 2MB and supports the following commands:

add       Add file contents to the index
branch    List, create, or delete branches
checkout  Checkout a branch to the working tree
clone     Clone a repository into a new directory
commit    Record changes to the repository
daemon    Export repositories over git://
diff      Show diffs
fetch     Update remote refs from another repository
init      Create an empty git repository
log       View commit history
merge     Merges two development histories
push      Update remote repository from local refs
rm        Stop tracking a file
tag       Create a tag
version   Display the version of jgit

You can download jgit.sh here http://www.eclipse.org/jgit/download/

like image 677
styfle Avatar asked May 05 '11 04:05

styfle


People also ask

Can you use GitHub without installing Git?

You do not need GitHub to use git, but you cannot use GitHub without using git. There are many other alternatives to GitHub, such as GitLab, BitBucket, and “host-your-own” solutions such as gogs and gittea.

Do I need to install Git to clone?

To clone your Github repo on Windows. If Git is not already installed, it is super simple. Just go to the Git Download Folder and follow the instructions. Go to the current directory where you want the cloned directory to be added.

Is Git automatically installed?

A download of the Windows Git installer will begin automatically.

Can I use Git alone?

Git can be leveraged as a powerful tool for solo developers, even though it's primarily geared towards team-based workflows. Adopting a branch-heavy workflow allow you to keep your code separate from the master branch. Committing often allows you to track and rollback problematic changes.


1 Answers

Or you can try out JGit, it is a single bash file that you can run basic Git commands. Git is self contained in that bash script.

To download JGit, choose the second link (Self contained command line executable) located here http://www.eclipse.org/jgit/download/ once downloaded, rename it to jgit.sh and just run it: jgit.sh (remember to chmod +x jgit.sh)

like image 118
Mohamed Mansour Avatar answered Sep 22 '22 10:09

Mohamed Mansour