Thursday, July 16, 2020
Create a local Git Repository
Git Repository provides storage of project files managed by git. There is a set of notes maintained at Notes on Git.
To setup a project with support for Git, use the following command, in the same folder as the project root folder.
The basic configuration for a username and email is required, to access any remote git repositories.
git config --global user.name "Tboxmy"
git config --global user.email "email@example.com"
There are many more configurations. Another example, for MS Windows PC that wants to preserve its end of line format, we can use
git config --global core.autocrlf false
In order to have a centralised repository, where one or many users can send changes to their files from other computers, we use a remote repository. This centralised repository is known as Bare Repository where users can send their project files over. Use the following command.
git init --bare <repo_name>.git
Then users can connect to this remote repository, and keep their files updated there.
git remote add <remote_name> <remote_repo_url>
In order to update remote repository with changes in files, a user can PUSH files there
git push -u <remote_name> <local_branch_name>
- ► 2018 (20)
- ► 2017 (20)
- ► 2016 (24)
- ► 2015 (34)
- ► 2014 (24)
- ► 2013 (30)
- ► 2010 (29)
- ► 2009 (54)