Head up: If you want to keep your files private you have to pay a fee each months. If you're using the Free version then all your files will be publicly accessible.
The installation process I describe here is for Ubunut 14.04 but works well in all other Debian based Linux distrobution I guess.Open up the terminal and type in the following command:
sudo apt-get install git
Before you start configure your settings: If your name is Bob Dole and you have an email address like bob.dole@mail.com then type in these lines (after each one press <enter>):
git config --global user.name "Bob Dole"
git config --global user.email bob.dole@mail.com
USING GIT |
044 |
045 | 1. git config --global user.name "Derek Banas" |
046 |
047 | 2. git config --global user.email derekbanas@verizon.net |
048 |
049 | 3. git config --global core.editor "vim" # Set editor as vim |
050 |
051 | 4. git config --global core.editor "edit -w" # Set editor as Text Wrangler |
Ok, now go back to your terminal.
Below I'll show you the most important git commands. First create a project by creating a folder: Go to the directory where you'd like to store your project folder. You can use
cd [folder name]
in order to go to the folder called "folder name" or you can use
cd ..
in order to step out of the current folder you're in.
Once you are in the directory of your choice, initialize your project folder:
git init
Now you have to connect your repository you created on GitHub.com with the local project folder.
git remote add origin https://github.com/bobdole/testRep.git
Of course your project folder has to contain something. As an example I'll just create a read-me file:git add README.md
Now whenever you want to synchronize your remote folder (the one on GitHub) with your local one you have to type in the following commands. If you're collaborating with mulitple users or working on your project different computers you have to first synchronize your local project folder with the remote one:
git pull
After that you have to add your changes. In order to keep in simple let's just add all files you created:git add --all
Next you can add comments to the changes you made: git commit -m "I made some changes"Now the remote folder on GitHub should be the exact copy of your local one. In order to do that execute the following command line:
git push -u origin master
After that you'll be asked to type in your GitHub user name and password. If the push was successful it will say something like
u0d25d07..46baad4 master -> master
Now that you have pushed your project other people or you yourself can access it on a different computer. In order to do that you have to clone the project onto your computer:
git clone https://github.com/bobdole/testRep.git
If you want to remove your remote repository, type in this:
git remote rm origin
No comments:
Post a Comment