You are so good at teaching. You ask the same questions I have during the video at the same time. This makes you more a teacher and a student who is sitting beside you wondering the same thing. Really nice.
Yep this is how we did things before github was a thing, and even after if you wanted private repos. People thing github is synonymous with git, important to know that they are not.
Hey there! I'm genuinely glad that I came across your channel & got to be a part of an amazing wealth/treasure of knowledge that is enlightening and informative. Thank you so much, & I'll join you over your discord server.. thanks again!
Wow. Best explanation, rich content. So many other channels spend so much time on fluff and groundwork, you just go straight to the point not worrying if you talk to fast (we are on RUclips after all, people can rewind!) - great work.
Thanks a bunch. I didn't know about this feature and have started using it right after watching your video. I'm the sole developer on all my personal projects (as an humble hobbyist) and I actually have no need for remote services.
Be careful, if you host all your repos on a local disk you risk losing them if something happens. A huge benefit of remote hosting (like that provided by github) is that you don't have to worry about losing your work for good. In fact, github recently backed up a ton of repositories to a secure arctic facility (arctic code vault) that stores several copies of data in different formats
@@harleyspeedthrust4013 You're absolutely right but I have that covered with daily backups on my NAS, an external HDD and a USB thumbdrive, plus weekly backups on a remote backup service. I have never considered github as a backup solution, just a necessity to host my workflow until I discovered I could just have it locally with this video. You're right though, DO BACKUP FOLKS ;-)
Great explanation, i stumbled upon bare repo when working with git worktrees and didn't understand what that bare repo i was having to pull was. Great and quick explanation, i even gasped when you cloned from a repo that was just on your local machine. All the abstraction that modern platforms provide kind of obstruct that this is "just" a fancy folder structure :)
and if you put that bare repo on a server that you have ssh access on, you now host your own git repos (also you can actually work on code in a bare repo by doing: git worktree add and cd )
I use one to make it simple to push my, mostly, dot files to GitHub. I can add a file from anywhere, commit it, and push it up to GitHub. So, if you look for tobeypeters on there, you'll see a dotfiles repo with my .bashrc and such.
Thank you, that was quite interesting and something I didn’t know about. I often clone gut repos to checkout the source code and will next time clone it as bare repos as I don’t have any interest to push anything I update. Thanks 🙏
Yes, if you have the original repo as the bare repo's upstream remote (e.g. if you cloned the bare repo from GitHub), then you can just "git push" from the bare repo. Any commits you've pushed to the bare repo will then get pushed to the upstream.
There's lots and lots of online resources and thus, lots of places to start. It's hard to point to one specific resource, but searching for "getting started with git", "git for beginners" or "git tutorial" will ger you something to work with :)
I think it's Xubuntu if I'm not mistaken. He mentioned this in a few videos, including "10 things you can do with Linux that you can't do with Windows ".
At 4:49, the files in felix_bare/ are listed with ls, and it shows all of the files within .git Shouldn't it just be listing .git, not the files actually in .git? At 4:35 you only moved .git into felix_bare/, right?
It depends on what you want. He explains the difference in the video. A bare git repo won't have your workspace. So if you want your complete repo backed up then you need to back up the whole thing. If you just want to be able to restore your project then the bare git will be the bare minimum to backup. Git it?
It seems clear how to clone the repo from a shared drive where would be the bare repo. But I have not grasped how to push, and pull. How do you define the remote, if this remote is not using neither ssh nor http ? Maybe your video goes a bit too fast on this.
Self answering: no explanation is needed, it is super extra simple => the fact of cloning the repo from the file system creates a git repo that does not need either ssh or https. When doing git push origin master, it will simpy copy to the filesystem address. Simple and direct like that. I could not believe it.
Question. If you commit something to the repository, does the bare repo update too? Since I've understood when you commit you do the commit to the actual repository, not the bare one.
Cool! I did not know that. Might not be a good question, since it's not for Git. Does the terminology and mechanics also apply to Mercurial. Cause it also has something like a .hg directory?
Mercurial/svn share /some/ of these concepts, but will be completely different commands (at the very least). But if you can help it, don't ever use mercurial/svn. The technology is so outdated and strictly worse than git in almost every way. The only benefit something like svn has is that it comes pre-packaged with a GUI and a little easier to get started with. Any serious engineer uses git and is the industry standard.
Just to share a cool way bare repos have helped me in the past - I had two non-networked computers that were being used to dev on a codebase. To keep things in sync, I created a bare repo on a removable hard drive, and cloned to both computers from the removable drive. Then once a day we'd plug the drive into each computer and do git pull..., git push.
Alsalam Alikom, I want to devolop a system that is like a githup, so, what shuld i do, bare repostry or non-bare, becouse the non-bare makes clients cannot push to origin if the origin is checkedout to master and the client too.
To convert to a bare repo, you could have just cloned the non-bare repo with the --bare flag. Also worth pointing out that you can do all of this with non-bare repos as well.
Mmm... Yes I was wondering why the big fuss? I see so many positive comments here, but from what I can tell the only advantage with the bare git is that it doesn't take up as much space since it is only the git folder. There are people gushing with praise for this video and how useful this tip is, but I don't see what is so great about it. What am I missing?
@@unabonger777 Correct you don't need git hub, you never did before this video. So why are people losing their minds about how awesome this video is? I am not trashing the video. I just don't get some people's reactions.
Using a local offline repo like you outline in this video might have some advantages, but doesn’t it leave you more vulnerable to losing your project? If you’re going to protect your work by backing up regularly (which we all should) wouldn’t it just be simpler to skip this whole bare repo thing and use an online service like GitHub?
There are situations where github isn't the right option. For me they happen a lot. The fact that git can be used in this way is why I fell in love with it to start with. I can start a small project, run "git init" in the folder, and suddenly I've got version control, branches, and the ability to let coworkers collaborate with me by doing "git clone ssh://user@myip:/path/to/the/repo". And if you spread the work across multiple computers, git is giving you a ghetto backup solution anyway, since both machines have the full repo.
You are so good at teaching. You ask the same questions I have during the video at the same time. This makes you more a teacher and a student who is sitting beside you wondering the same thing. Really nice.
Yep this is how we did things before github was a thing, and even after if you wanted private repos. People thing github is synonymous with git, important to know that they are not.
You can also use a bare repo and the hook scripts ( post-receive for example ) as a deployment mechanism too.
Huh, I never actually thought to use them for that purpose. Nice one.
Hey there! I'm genuinely glad that I came across your channel & got to be a part of an amazing wealth/treasure of knowledge that is enlightening and informative. Thank you so much, & I'll join you over your discord server.. thanks again!
Wow. Best explanation, rich content. So many other channels spend so much time on fluff and groundwork, you just go straight to the point not worrying if you talk to fast (we are on RUclips after all, people can rewind!) - great work.
Finally I don't need to factor the tempo of the video by 1.5 or 2 to follow it without falling asleep or getting distracted. 😄
Clear, informative, straight to the point, no drama, and useful.
Perfect for me. Best communication mode ever.
Thanks !
Thanks a bunch. I didn't know about this feature and have started using it right after watching your video. I'm the sole developer on all my personal projects (as an humble hobbyist) and I actually have no need for remote services.
Be careful, if you host all your repos on a local disk you risk losing them if something happens. A huge benefit of remote hosting (like that provided by github) is that you don't have to worry about losing your work for good. In fact, github recently backed up a ton of repositories to a secure arctic facility (arctic code vault) that stores several copies of data in different formats
@@harleyspeedthrust4013 You're absolutely right but I have that covered with daily backups on my NAS, an external HDD and a USB thumbdrive, plus weekly backups on a remote backup service. I have never considered github as a backup solution, just a necessity to host my workflow until I discovered I could just have it locally with this video. You're right though, DO BACKUP FOLKS ;-)
Years later and this is one of the best videos on this topic.
These videos git better every time!
Before I said "Igitigit", but now I say "Super".
Great explanation, i stumbled upon bare repo when working with git worktrees and didn't understand what that bare repo i was having to pull was. Great and quick explanation, i even gasped when you cloned from a repo that was just on your local machine. All the abstraction that modern platforms provide kind of obstruct that this is "just" a fancy folder structure :)
didn't even know I needed this, but I needed this so urgently
and if you put that bare repo on a server that you have ssh access on, you now host your own git repos
(also you can actually work on code in a bare repo by doing: git worktree add and cd )
I scratched my head for few hours and thank god I found you...so clear and precise explanation..
Sometimes I really don't know whether im gonna use this knowledge or not, I just enjoy knowing it.
This is a great and concise video. If you are looking into converting a regular repot to a bare repo see 4:20
i discovered doing this by accident! now i'm able to have a private bare repository with all my important files that i wanna keep track on
Clear, concise and helpful, thanks :)
well that was intersting
hopefully someday I'll need it, thanks Engineer Man!
Very on point and well made video, congrats!
2:24 Wrong! THis is sooooo useful! I absolutely need this! Thank you so much!
Ummm.... Are you short on storage space or something? The bare repo doesn't do anything that the full one doesn't.
For one, other people can't push to a branch in another repo that has the same name and is currently checked out.
@@EngineerMan I see. I must have missed that in the video.
Very cool. It seems I have more to learn about Git every day.
I use one to make it simple to push my, mostly, dot files to GitHub. I can add a file from anywhere, commit it, and push it up to GitHub. So, if you look for tobeypeters on there, you'll see a dotfiles repo with my .bashrc and such.
Great, exactly what I needed to know.
Amazing explanation. Thank you!
Wonderful explanation 👌🏻, thank you 🙏🏻
Cool! Now please make video about how to host our own git repos in our own linux server so we can access them across the internet.
I think an ftp server would work, you could put it's ip in when you're cloning
Have you looked into using GitLab?
www.techrepublic.com/article/how-to-set-up-a-gitlab-server-and-host-your-own-git-repositories/
@@sabrinnnaaaaaaa You can use ssh and set up a shared directory on the server for the repos to live in.
Who dem downvotes?!
This is GOLD! Man an amazing channel!
Sir Could you please make a video explaining the resources you use to learn or enhance your programming skills
Keep in mind he's been programming for 20 years.
The best answer to this is to actually build things.
Bare repo for dotfiles
This is such a easy way to manage dotfiles across multiple systems and track them easier
Man, you are amazing
Great video! Do you use bare repo w/ worktrees? (git worktree add)
So clear. Thanks
Great video and very interesting concept ❤
Great! Would be very interesting to see this in convination with git worktree
This is so obvious I feel silly for not thinking about this earlier. Is this how people used git before github and gitlab?
Yes, particularly useful for internal networks and ones with shared drives.
Thank you, that was quite interesting and something I didn’t know about. I often clone gut repos to checkout the source code and will next time clone it as bare repos as I don’t have any interest to push anything I update. Thanks 🙏
You missed the point of the video. You won't get any source code with a bare repository that is the whole point of it.
heinzerbrew wrong
@@bulletinmybeard How so?
If I pull in a bare repo and that becomes the core from which I get my workspaces, can I then later push to original repo?
Yes, if you have the original repo as the bare repo's upstream remote (e.g. if you cloned the bare repo from GitHub), then you can just "git push" from the bare repo.
Any commits you've pushed to the bare repo will then get pushed to the upstream.
Okay, this is pretty awesome.
one more time u saved my a**, thanks alot Engineer Man!
Dark souls players don’t want you to know this is where you can actually git gud
\o/
praise the sun ( son ) of nils torvalds
Wow, that's pretty nifty.
Great stuff
Thanks a lot!
cool video, straight to the point, thanks! How would you go about hosting a bare repo on a cloud service like AWS?
Good video E-Man :)
Many thanks
Great video!
thanks man
this is gold
Thanks!
I don't know what most of this means, but I really want to learn... Where do I start?
Where did you start? And what resources have you used?
There's lots and lots of online resources and thus, lots of places to start. It's hard to point to one specific resource, but searching for "getting started with git", "git for beginners" or "git tutorial" will ger you something to work with :)
hey man, what distro do you use? i really wanna know what terminal & what colorscheme you're using
Thanks
Thanks for the video!,
may i ask what OS r u using in that video? its not Ubuntu right?
I think it's Xubuntu if I'm not mistaken. He mentioned this in a few videos, including "10 things you can do with Linux that you can't do with Windows
".
How can we add this GIT repo to our Jenkins job to build ? Is that even possible? Kindly let me know. Thank you in advance !
At 4:49, the files in felix_bare/ are listed with ls, and it shows all of the files within .git
Shouldn't it just be listing .git, not the files actually in .git?
At 4:35 you only moved .git into felix_bare/, right?
Git rebase vs cherry pick plzz
Would a bare Git repo be the way to go when making a backup of a existing Git repo?
It depends on what you want. He explains the difference in the video. A bare git repo won't have your workspace. So if you want your complete repo backed up then you need to back up the whole thing. If you just want to be able to restore your project then the bare git will be the bare minimum to backup. Git it?
It seems clear how to clone the repo from a shared drive where would be the bare repo. But I have not grasped how to push, and pull. How do you define the remote, if this remote is not using neither ssh nor http ? Maybe your video goes a bit too fast on this.
Self answering: no explanation is needed, it is super extra simple => the fact of cloning the repo from the file system creates a git repo that does not need either ssh or https. When doing git push origin master, it will simpy copy to the filesystem address. Simple and direct like that. I could not believe it.
Does git fetch work in a bare git repo?
Question. If you commit something to the repository, does the bare repo update too? Since I've understood when you commit you do the commit to the actual repository, not the bare one.
If I understand correctly, the bare repo acts like a fork, so it wouldn't update with the original repo
You have to push to the bare repo, as you would with a remote repo (github, etc).
Cool! I did not know that.
Might not be a good question, since it's not for Git. Does the terminology and mechanics also apply to Mercurial. Cause it also has something like a .hg directory?
Mercurial/svn share /some/ of these concepts, but will be completely different commands (at the very least). But if you can help it, don't ever use mercurial/svn. The technology is so outdated and strictly worse than git in almost every way. The only benefit something like svn has is that it comes pre-packaged with a GUI and a little easier to get started with. Any serious engineer uses git and is the industry standard.
@@bdafeesh Thanks! Good advice.
Wild
That's so cool
Just to share a cool way bare repos have helped me in the past - I had two non-networked computers that were being used to dev on a codebase. To keep things in sync, I created a bare repo on a removable hard drive, and cloned to both computers from the removable drive. Then once a day we'd plug the drive into each computer and do git pull..., git push.
Alsalam Alikom,
I want to devolop a system that is like a githup, so, what shuld i do, bare repostry or non-bare, becouse the non-bare makes clients cannot push to origin if the origin is checkedout to master and the client too.
I think you answered your own question. GitHub likely uses bare repos as the base.
Which linux distro is he using?
How to push a bare repo to GitHub and make as a GitHub project??
To convert to a bare repo, you could have just cloned the non-bare repo with the --bare flag. Also worth pointing out that you can do all of this with non-bare repos as well.
Mmm... Yes I was wondering why the big fuss? I see so many positive comments here, but from what I can tell the only advantage with the bare git is that it doesn't take up as much space since it is only the git folder.
There are people gushing with praise for this video and how useful this tip is, but I don't see what is so great about it. What am I missing?
@@heinzerbrew You use ssh and set up a shared folder on a server for your remotes. So you don't need github, etc.
@@unabonger777 Correct you don't need git hub, you never did before this video. So why are people losing their minds about how awesome this video is? I am not trashing the video. I just don't get some people's reactions.
Could anyone tell me what's a workstation?
A computer you do work on. Eg a desktop or laptop
@@benjamincvcvcv7 Ah, gotcha. Thanks for the info!
I've watched this video 3 times through now and as a regular (newbie) user of git, I can't grasp why this is useful. 😔 Went right over my head
So you can use a local folder instead of a remote service like github to pull/push from.
@@user-yb1cm4fd6h thanks for response. Think I need to research a bit more 👍
@@user-yb1cm4fd6h ummm you can do that with a regular repository.
What distro is he using?
xubuntu
how to update installer packages from git clone?
BEAR REPO
Did it all with my bear hands.
what i learned use git add -A instead of git add .
I wish this video ended at 2:28
🐻
Converting Non-bare repo to Bare repo: ruclips.net/video/8aZW9mYOxhc/видео.html
@engineerman Thanks for this good explanation!
Very very very explanatory video...
It needs that exaggeration.
Using a local offline repo like you outline in this video might have some advantages, but doesn’t it leave you more vulnerable to losing your project? If you’re going to protect your work by backing up regularly (which we all should) wouldn’t it just be simpler to skip this whole bare repo thing and use an online service like GitHub?
There are situations where github isn't the right option. For me they happen a lot. The fact that git can be used in this way is why I fell in love with it to start with. I can start a small project, run "git init" in the folder, and suddenly I've got version control, branches, and the ability to let coworkers collaborate with me by doing "git clone ssh://user@myip:/path/to/the/repo". And if you spread the work across multiple computers, git is giving you a ghetto backup solution anyway, since both machines have the full repo.
i know git bare repo is from oxidized (rancid alternative)
Your subtitles are only in Russian. Can you put them in English?
I have Russian subtitles?
@@EngineerMan It is the option that appears.
@@EngineerMan haha
It generated automatically)
RUclips is kidding
@@EngineerMan but I can help you with Russian subtitles
4th :-)
First