Justin Olson
Justin Olson

Reputation: 126

Using github locally without publishing to github servers

I started working at a company that uses a complex version control software, and the project I am working on is a standalone utility, unrelated to any existing codebase. I would like to use github for local version control because it is just hands down the best. The only issue is the policy is no company ip can be on any non company machine. so I cannot push to github servers. I have used github on a local branch before, however it still had the remote origin on github. Is there a way to setup the entire repo locally? I understand there would be no backup, I mainly need it for branch tracking, diff, and potentially revert commits if something goes wrong.

Upvotes: 2

Views: 2655

Answers (1)

Gregg
Gregg

Reputation: 2624

Yes you can use git for local repositories only (avoiding GitHub altogether). To create a git repository (with no origin, or connections to anything external) The repository will be created in /.git

cd <mycodedirectory>
git init

To add files to the repository including all the .c and .h files

git add <file1> <file2> *.c *.h
git commit -m"starting commit"

From here you can use all the git commands as normal. See these general helps

git help
git help -a 
git help -g

Upvotes: 2

Related Questions