Beginner Git Tutorial
Managing your repositories has never been easier on the eyes – GitKraken’s intuitive organization will ensure quick access to your Git projects.
Git Repository
A Git repository, or repo, is a project folder that Git tracks. Git stores every version of every file, plus the full commit history, in a hidden .git folder at the root of the project. If you delete that folder, your files stay, but their history is gone.
Create one: Run git init in a folder, or git clone <url> to copy an existing repo
Local repository: The copy on your computer, where you edit files and make commits
Remote repository: A hosted copy on GitHub, GitLab, Bitbucket, or Azure DevOps that your team shares
How to Create a Git Repository with GitKraken Desktop
GitKraken Desktop will create the Git repository for you when you initialize a project.
Let’s say we just created a folder in Finder or File Explorer where we plan to build out our project. Now we can open GitKraken Desktop and navigate to the folder icon in the upper left, and then select the INIT tab.
Browse for the folder previously created, and click Initialize! This action creates the .git/ folder in your project, which watches and tracks changes to your files. This also includes any new files you add, rename, or remove from the repository.
The process to create and clone Git repositories in GitKraken couldn’t be simpler, allowing Git newbies to get involved in team projects.
What is a repository in GitHub?
A GitHub repository is a Git repository hosted on GitHub. It holds the same files and commit history as your local repo, plus GitHub features like pull requests, issues, and Actions. You push commits from your local repo to GitHub, and you pull your teammates’ commits back down.
Git is the version control tool, and GitHub is a service that hosts Git repositories. Every GitHub repository is a Git repository, but a Git repository doesn’t have to live on GitHub.
How to create a Git repository from the command line
cd my-project
git init
To connect it to a new, empty GitHub repository and push your code:
git remote add origin https://github.com/OWNER/REPO.git
git push -u origin main
To copy an existing repo instead, run git clone https://github.com/OWNER/REPO.git.
GitKraken Desktop shows your repository’s branches and commits in a visual graph, so you can see your project’s history instead of reconstructing it from the terminal. Download GitKraken Desktop free.
FAQ
Is a GitHub repository the same as a Git repository?
Yes. A GitHub repository is a Git repository stored on GitHub, with collaboration features added.
What happens if I delete the .git folder?
Your files stay, but Git loses the commit history, branches, and remote connections for the project.
Can a repository have more than one remote?
Yes. Run git remote -v to list them. A fork usually has two remotes: origin (your fork) and upstream (the original repo).
What’s the difference between a public and private repository?
Anyone can view a public repository. Only people you give access to can view a private one.
GitKraken MCP
GitKraken Insights