We'll go over how to set up a git local repository after installing git-bash or Git on your laptop or desktop in this tutorial.
If you're new to Git and need help installing it, Go Here. It will redirect you to the video tutorial, where you may follow the onscreen instructions.
OR checkout this video Guide:
Note:
This article is only applicable to Linux or Unix environments.
Now let's see how to setup?
1. After installing Git-bash, run the following commands to configure user details at once.
2. User details have been successfully configured in Git, and you can verify and edit them using the instructions below by launching gitbash.
4. What is the next step? Make a Git local repository on your laptop or desktop computer.
- git config --global user.name "chandrasekhar"
- git config --global user.email "csrk@gmail.com"
- git config --list (aall configurations will be displayed).
- git config --global --list (only user name and user email will display)
- git config --global --edit (for editing the user details).
3. If you only want to see the user name and email address, use the gitbash instructions below.
- git config user.name
- git config user.email
- First, create a directory named git-practise and navigate to it.
- $ mkdir git-practise
- $ cd git-practise
5. Create a local Git empty repository with the following command:
- $ git init
Initiated a new Git repository in C:/Users/crklive/Desktop/git/myrepo/git-practice/.git/.
We have now successfully initialised the git local empty repository, and you can use the following command to check the status of the untracked files.
$ git status
On branch master
No commits yet.
nothing to commit (create or copy files and use "git add" to track).
Conclusion
In this tutorial, we learnt how to set up user details as well as a git local repository on your laptop or desktop computer. Follow my YouTube channel and experiment on your own if you want to do some R&D.