Git və GitHub
What is Git və GitHub?
Git was written by Linus Torvalds in 2005. It remembers the files in a folder step by step. Each step is called a commit. You can return to an old step. This program lives on your machine. A commit can be written with no internet. GitHub is something else. It is Microsoft's site. When you send a commit there, the history sits in a folder on the internet. If the computer dies, that copy remains. Someone else can see it too. Issues, pull requests, and showing a page are the site's own services. They are not a Git command.
What is Git və GitHub used for?
Git keeps your own step. GitHub shows that step to someone else and to tomorrow's you.
- Returning a file to yesterday's state
- Two people working in the same folder
- Letting someone else see the finished code
- Keeping a copy if the computer breaks
What can you do with Git və GitHub?
With Git you write a step, see the difference, and go back. With GitHub you send that step, take someone else's step, and keep the code at an address. GitHub itself is not the magic that remembers the file. Git has to write the step first. Then push puts that step on the site. Pull brings a new step from the site into your folder. If the site is down, Git stays on your computer. Without Git you can only upload a plain file to the site, and no step history appears.
Is Git və GitHub hard to learn?
Writing one commit is easy. The difficulty starts when two histories mix. If two people changed the same line, Git does not choose the right one. You choose. If push is refused, the site usually has a new step that you do not have. A pull is needed first. Do not write a password or a key into the code. An open folder sent to GitHub is read by anyone. When a secret key falls in there, deleting it is not enough. The key has to be changed too.
Advantages and limits
Git stores a step on your computer quickly and lets you go back. GitHub keeps the copy on the internet and opens a way for someone else. One does not take the other's place. Throwing a file onto the site without learning Git does not create history. You can work without GitHub, but if the machine breaks the steps can go too.
Basic ideas
Four words are enough: a commit is a step, push is sending, pull is bringing, and GitHub is the site where the address sits.
- Git is a program, GitHub is a site
- A commit is the name of one step
- Push puts the step on the site
- Pull brings the step from the site
A short example
These three commands write a step and send it to GitHub. The site address has to be the address of your folder.
git add . git commit -m "ilk addım" git push
Common questions
- Are Git and GitHub the same? No. Git is a program. GitHub is a site that can keep that program's steps.
- Does Git work without GitHub? Yes. The step stays on your computer. Someone else does not see it, and if the machine breaks there is no copy on the site.
- What does push do? It sends the commit you wrote into the folder on the site. It does not create a new step by itself.