More git stuffs
source link: https://blog.josemcastaneda.com/2022/11/04/more-git-stuffs/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
More git stuffs
The other day I was thinking random things and of course git came to mind as well. One of the things that really distracted me was how git really functions. In some previous posts I had looked a little closer on what WordPress functions, hooks, and filters sort of do. I haven’t really done much posting on that but that is also because I’ve been looking at other things since.
A little more and more on how git does things. I had also looked into how MySQL works internally but that was a temporary thing. Anyways, I started to dive back a little more into how git works and figured I would post here because this may end up helping at least one person who reads this. Other than me.
The git init
command is one of the first commands I never really looked into. The reason being is that when I first started my git journey it wasn’t the first command I learned. The first command was git clone
. Biggest reason was because it was in just about all the tutorials I had read on how to clone things down using git. Let’s be honest here, it’s not really one of the commands you really think of right away when it comes to using git.
So I began to look a little closer and read the documentation.
git-init – Create an empty Git repository or reinitialize an existing one
https://git-scm.com/docs/git-init
It threw me off a little bit because I wasn’t quite expecting to see reinitialize. It was pretty cool to read that, and even cooler to know that it can do that. Earlier today I felt like running the command to see what it is that gets created. At the time of writing this git is on version 2.38.1 and I’m using Fedora 37; I ran the command and a few files and directories were created. The following is the structure and files that get created after running the init
command. All of which resides inside of a .git
folder that also gets created in the directory.
├── branches
├── config
├── description
├── HEAD
├── hooks
│ ├── applypatch-msg.sample
│ ├── commit-msg.sample
│ ├── fsmonitor-watchman.sample
│ ├── post-update.sample
│ ├── pre-applypatch.sample
│ ├── pre-commit.sample
│ ├── pre-merge-commit.sample
│ ├── prepare-commit-msg.sample
│ ├── pre-push.sample
│ ├── pre-rebase.sample
│ ├── pre-receive.sample
│ ├── push-to-checkout.sample
│ └── update.sample
├── info
│ └── exclude
├── objects
│ ├── info
│ └── pack
└── refs
├── heads
└── tags
The part I really like is those sample files. It honestly was not something I had expected but again this was the first time I really began to look a little closer on how things are managed and created within git. Each one of those files and folders of course does hold some purpose and the documentation does go cover that.
This is part one I guess. To be honest I’m not really sure how many I want to do but I do know I want to look at other git commands. Hopefully this does turn into a better series than my fun with hooks/functions one I had previously done.
Leave a Reply Cancel reply
Your email address will not be published. Required fields are marked *
Comment *
You are limited to 500 wordsName *
Email *
Website
If you do not see your comment in the next 24 hours, please emailjose[at]josemcastaneda[dot]com
Recommend
-
38
Git has become the distributed version control system of choice for modern development. Combined with the rise of GitHub (and its competitors), this has made Git a must-have skill for developers. Yet many developers only...
-
8
Learn Linux, Vim, Git, Tmux, Gpg and more
-
1
When it comes to git history, less is more Stephen Brennan • 15 June 2021 At a previous company, there was an “infamous” commit in our main repository. The commit was about 10 years old, and it replaced every tab wit...
-
7
News Samsung Stuffs More Tech Into Wearables with Industry’s First 5nm Processor 3 days ago by Jake Hertz The struggle to inclu...
-
0
Files Permalink Latest commit message Commit time
-
7
CurateCataloging with amazing stuffs daily.
-
5
#gitcli
-
2
Sometimes we need to use more than one Git user in the same machine. This is simple to configure but we need to know a few things before using this feature. Creating an additional SSH key
-
5
skip007 commented
-
7
Google Meet stuffs more features into its picture-in-picture mode with new update...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK