Skip to content
forked from tp-labs/lab02

Изучение систем контроля версий на примере Git

License

Notifications You must be signed in to change notification settings

tizl1234/lab03-clone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Laboratory work III

Данная лабораторная работа посвещена изучению систем совместной разработки на примере сервиса GitHub.

$ open https://github.com

Tasks

  • 1. Зарегистрироваться на сервисе совместной разработки GitHub
  • 2. Создать публичный репозиторий с названием lab3 и с лиценцией MIT
  • 3. Отправить личным сообщением ссылку на созданный репозиторий в Slack
  • 4. Выполнить инструкцию учебного материала
  • 5. Ознакомиться со ссылками учебного материала

Tutorial

$ export GITHUB_USERNAME=<имя_пользователя>
$ export GITHUB_EMAIL=<адрес_почтового_ящика>
$ mkdir lab3 && cd lab3
$ git init
$ git config --global user.name ${GITHUB_USERNAME}
$ git config --global user.email ${GITHUB_EMAIL}
$ git config -e --global
$ git remote add origin https://github.com/${GITHUB_USERNAME}/lab3
$ git pull origin master
$ touch README.md
$ git status
$ git add README.md
$ git commit -m"added README.md"
$ git push origin master

Добавить на сервисе Github в репозитории lab3 файл .gitignore со следующем содержимом:

*build*/
*install*/
*.swp
$ git pull origin master
$ git log
$ mkdir sources
$ mkdir include
$ mkdir examples
$ cat > sources/print.cpp <<EOF
#include <print.hpp>

void print(const std::string& text, std::ostream& out) {
  out << text;
}

void print(const std::string& text, std::ofstream& out) {
  out << text;
}
EOF
$ cat > include/print.hpp <<EOF
#include <string>
#include <fstream>
#include <iostream>

void print(const std::string& text, std::ostream& out = std::cout);
void print(const std::string& text, std::ofstream& out);
EOF
$ cat > examples/example1.cpp <<EOF
#include <print.hpp>

int main(int argc, char** argv) {
  print("hello");
}
EOF
$ cat > examples/example2.cpp <<EOF
#include <fstream>
#include <print.hpp>

int main(int argc, char** argv) {
  std::ofstream file("log.txt");
  print(std::string("hello"), file);
}
EOF
$ nano README.md
$ git status
$ git add -p
$ git add .
$ git commit -m"added sources"
$ git push origin master

Links

About

Изучение систем контроля версий на примере Git

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published