- Download git from here.
- Run the executable and be sure at this step to select the second radio button.
The reason behind this is to add git to the PATH
- Just go with the default settings for the rest of the setup
- Open a console, "Windows Terminal" or "cmd" if you are using Windows
- Type the command in the console and then run it
git -v
- If you see the following message, then the setup completed with succes!
- If you don't see this message in the console, please reboot your system.
- Follow the tutorial from here.
- Please be aware that in windows you don't need to use the cat command in order to open a file, you can just open with notepad
- After completing the tutorial, check if the SSH connection is working as in this tutorial.
- If you don't receive the message from the picture below, then something is not working
Reason for doing the SSH clone setup: It is easier to work with github in this manner, because you won't be asked for the credentials everytime you push something to the remote repository.
Git is the versioning tool used to make "commits" on the code files or any other files. It works in three simple steps:
- Register a file creation.
- Register every change made to that file.
- Profit!
Now the programmer has the ability to revert to any "commited" version of the file any time he wants. You can imagine that you can't CTRL+Z a file with 500 words until the 1 word was written in the file.
With Git you can do this!
Github is not a versioning tool! Github is just a solution offered by Microsoft to store the data that the Git tool is using, that being all the files inside a repository. A repository is just a programmer way of saying folder.
For a better comparison, you can refer to this brief article.
- Create a folder in which you want to host your repo.
- Suggestion of file structure: "D:_code\image-processing"
- ! You do not have to create the "image-processing" folder, it will be created automatically after cloning the repo from Github !
- Open a console in the "_code" folder by typing "cmd" in the address path bar.
- Copy the SSH link from Github.
- Clone the repo by using the command.
git clone [email protected]:marcutudor79/image-processing-ETTI-mi.git
- Now you should see all the files from the repo locally on your computer.
- Please note that Git does not keep the files up to date with the ones from the repo (that could be dangerous).
- You can update your local files by running the command in a console opened inside the repository folder.
git pull
This command will automatically download and merge all the files from Github to your local folder
- OPTIONAL: You can update ONLY your local file history with the one from Github by running the command
git fetch
This command will only bring the differences from Github in your local repo, so that it knows that something changed on the remote repository from Github.
- Additional references can be found at https://www.geeksforgeeks.org/git-difference-between-git-fetch-and-git-pull/.