User Tools

Site Tools


git

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
git [2020/12/23 18:46] chifekgit [2025/07/30 09:30] (current) chifek
Line 1: Line 1:
-====== Частые команды git ======+[[git_config|git config]]
  
 +[[git_log|git log]]
  
 +[[rename_branch|Переименование и удаление ветки]]
 +
 +[[remove_remote|Уделение remote]]
 +
 +[[git_hook|Проверки перед коммитом]]
 +
 +[[add_remote|Добавление remote]]
 +
 +[[git_squash|git squash]]
 +
 +[[new_project_git|git new project]]
 +
 +[[zsh|Colored git branch in mac]]
 +
 +====== Частые команды git ======
 +
 +<code>git reset HEAD~1</code> где 1 это количество коммитов в которых были удалены файлы. Потом аккуратно убираете удаленные файлы из staging area и пушите все изменения на место.
 +<code>git clean -f -d or git clean -fd</code> удаляет Untracked files
 +<code>git remote -v</code>  показывает remote url
 <code>git branch -r</code>  показывает remote ветки <code>git branch -r</code>  показывает remote ветки
 <code>git branch -a</code>  показывает все ветки <code>git branch -a</code>  показывает все ветки
Line 9: Line 29:
 <code>git reset <file></code> убирает с добавленных файл (отменяет git add <file>) <code>git reset <file></code> убирает с добавленных файл (отменяет git add <file>)
 <code>git revert —no-edit <hash></code> -  откатывает указанный коммит к предыдущему значению.  <code>git revert —no-edit <hash></code> -  откатывает указанный коммит к предыдущему значению. 
- +<code>git commit -a -m “Commit title”</code>- коммитит с добавлением всех измененных файлов, т.е. вместо <code>git add . && git commit -m “Commit title”</code> 
-<code>git commit -a -m “Commit title”</code> - коммитит с добавлением всех измененных файлов, т.е. вместо <code>git add . && git commit -m “Commit title”</code>+<code>git log —oneline </code>показывает в одну строку коммиты 
 +<code>git log —stat —graph</code>показывает детальный log  
 +<code>git log <file name></code>история изменений (коммитов) в файле
  
git.1608749206.txt.gz · Last modified: 2023/09/14 06:06 (external edit)