Giter Site home page Giter Site logo

learn_git's Introduction

git-config

Действия после установки git

посмотреть настройки

git config --list
git config --global user.name “имя”
git config --global user.email “почта”


git config --global core.safecrlf warn
git config --global core.quotepath off
git config --global init.defaultBranch main # Ветка по умолчанию

windows

git config --global core.autocrlf true

MAC & UNIX

git config --global core.autocrlf input

Действия при инициализации нового репозитория и при работе с ним

инициализация git репозитория

git init

текущее состояние репозитория

git status

добавить в трек (отслеживаемые) файл или папку

git add index.html

добавить все файлы из корня в трек

git add .

выполнить коммит (сделать слепок) текущего состояния проекта

git commit -m "сообщение"
git log --oneline  посмотреть историю коммитов

### показывает изменения
```shell
git diff
git diff --color-words // показывает по строкам изменения

отменить коммит "ПЕРЕПИСЫВАЕТ ИСТОРИЮ"

вернуться к коммиту старому но оставить текущие изменения

git reset 'HASH commit'

вернуться к коммиту и удалить все изменения

git reset --hard 'HASH commit'

откатить изменения у всех файлов трека

git checkout .  
git checkout name.file  // откатить изменения в одном файле или каталоге

откатить изменения в одном файле или каталоге

git checkout name.file

отправить изменения в удаленный репозиторий

git push 

клонирование репозитория

git clone https://github.com/Quper87/git-lesson.git

сохраняет изменения отслеживаемых файлов и выполняет коммит

git commit -a -m 'сохраняет изменения отслеживаемых файлов и выполняет коммит'

learn_git's People

Contributors

maksim-methed avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.