Github Quick Start Guide - RimasTr/sdp-group6 GitHub Wiki
First time using git?
You should set your name and email. Just type in the terminal:
git config --global user.name "John Smith"
git config --global user.email [email protected]
You can also set the default editor (I'm using nano - a very simple one):
git config --global core.editor nano
Get the code
Open the terminal in the directory you want the code in (or navigate to it using e.g. cd ~/workplace/sdp/
) and type:
git clone https://[email protected]/RimasTr/sdp-group6.git
Replace YourGitUsername with your git username (yeah, I know, but some of you probably already copy-pasted this command without changing anything. :) ).
Made some changes?
Make sure everything is working. You can check which files you've changed by typing:
git status
To see the exact changes, use:
git diff
If you want to commit some of these files to the repository, just type:
git add some-directory/file-name.ext another-directory/another-file.ext
Or you can add all the files by typing:
git add .
(you must be in the root directory)
After that you should commit the files by typing:
git commit
The default editor will be opened for you to write a short summary of the changes you made.
Keep in mind that the changes are not yet visible to everyone else.
Ready to share you commit(s)?
First of all, to get the latest code from the repository, type:
git pull
...and expect that no one else have changed the files you changed. Or that git would resolve the conflicts automatically. It happens most of the time. If it doesn't... good luck. :-D
Now, type:
git push
You'll be asked to enter your password. After that your commits should be visible here.
I advise you to push the code into the repository as often as possible (i.e. when you've done some changes and everything is working, even if you have some more ideas for improvements). It would help to avoid merge conflicts. And sometimes they can be very painful...
As you can see, it's a very simple summary. You can find more information about these (and other) git commands here. Or, of course, google. :)