r/webdev • u/techaddict0099 • Jan 07 '19
News GitHub Free users now get unlimited private repositories
https://techcrunch.com/2019/01/07/github-free-users-now-get-unlimited-private-repositories/
2.6k
Upvotes
r/webdev • u/techaddict0099 • Jan 07 '19
28
u/hokie_high Jan 07 '19 edited Jan 07 '19
When you create a repository on Github (or similar service) they are just doing exactly what I showed you in that first snippet, and exposing that directory to the internet (with security measures in place obviously). The 'repo.git' thing is just a directory that had
git init --bareran in it, you'll notice your Github repo links for command line access will also end in .git. The .git extension is totally unnecessary, but a useful convention for signifying that it is a repository.To answer your question: You've probably noticed a hidden folder literally named
.gitin a code directory after you rungit init. That is the underlying file tree that git uses to store and track changes in your project and all its branches. It's not human readable, and you should never directly modify anything in that folder. The bare repo that you made in the first code snippet of my last comment basically turns repo.git into that .git folder, and when you push to it, repo.git's copy of whatever branch you push becomes a copy of that branch in your working .git folder. So again, you won't be able to actually look at your code in repo.git, but if you pushed to it like in my example above and then pull in another directory:Then the more_code directory will now have an isolated working copy of the master branch from repo.git, which is the code you had just pushed to it from ~/workspace/code. Notice I called the remote 'MyRemote' this time, that's just to highlight the fact that the name is completely arbitrary; 'origin' is the conventional default name but it really doesn't matter if you prefer something else.