Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What to do with a .git directory?

Tags:

git

I got a .git directory for me to work on, supposedly containing files and data to run.

I only a see a bunch of directories (branches, hooks, info, objects, refs) and some files (config, description, HEAD), but can't figure out what to do with them.

I'm assuming I should somehow link it with GitHub, except I have no idea how.

like image 537
ytrewq Avatar asked Dec 11 '22 13:12

ytrewq


2 Answers

I suppose what you got is a bare repository. In order get the files out of it, you must create a non-bare clone.

Assuming that the directory you have mentioned is located at /path/to/my/repository.git, then by running the following command in a terminal:

git clone /path/to/my/repository.git /output/directory

you will find the contents of the repository in /output/directory/.

(You have to replace the directory paths with actual paths on your computer.)

like image 176
mkrieger1 Avatar answered Dec 13 '22 02:12

mkrieger1


You should install GIT to use the GIT repository. Get it here: https://git-scm.com/downloads

After you download and install it. you can open a CMD and type

git branch --list 

to see what branches are in the repo. and run

git checkout [branchename] 

to build the branch filesystem.

To push to a remote, type

git remote add origin <your repository address>

and to push to your git repo:

git push origin --all
like image 40
Dennis van Schaik Avatar answered Dec 13 '22 03:12

Dennis van Schaik