![]() ![]() How to set up a git repository on a remote server Once you have finished on your local machine you can move to the server. $ git commit -m "Commit message describing things you did." Now your local git repository is ready to use and you can work in it and commit your changes following a workflow similar to this. gitĪs you can see git created a hidden directory which it uses to keep all the files it needs to track your work. Listing the content of the directory will show you something like this: $ ls -lhaĭrwxrwxr-x 3 m3xican m3xican 4.0K Dec 4 00:45. Initialised empty Git repository in /path/to/YourProjectName/.git/ Now you’re inside your project directory and you can create a git repository with the following command: $ git init The first thing you need to do to set up a git repository locally is creating a new directory and move to it $ mkdir YourProjectName Git objects are files used by git to keep track of all your data and its multiple revisions.įor this tutorial I am assuming you will be setting things up on a Linux server, but the process is pretty much the same on other operating systems. When you create a bare git repository it only contains git objects and it will only contain git objects even after you start pushing content to it. A bare git repository is a special repository without a working directory. ![]() In case you wanted to share your files with other people or access them from other machines, all you need to do is to create a bare repository on a server and push your changes there. Basically a git working directory is a local repository which tracks revisions of your files and a history of your commits. You will need this for sharing your work with other people and/or machines.Ĭreating a new git repository on your local machine is a very simple operation which gives you a full working directory. This is a clear and simple step-by-step tutorial showing how to set up a git repository locally and on a remote server.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |