Можно использовать credentials.txt в gitignore
git init
git config --global user.name "John Doe"
git config --global user.email johndoe@example.com
git add index.html = > adds a file
git add css/ = > adds a dir
git add . = > adds all files from the dir
git add *.html = > add by file type
git add css/* = > add all files from dir
git add css/*.html = > add html files from dir (without child dirs!)
git add css/**/*.html = > add html files from dir (with child dirs!)
git add !css/style.css = > add all files from dir except style.css
git add !index.html = > add all files except index.html
git add !*.html = > add all files except html files
git status = > status
git rm --cached index.html = > remove from await list (cache)
git rm --cached <file>... = > to delete some files from the cache
git commit = > send to local cache
git commit -m “some comment” = > comment without Vim
git log
git log —oneline
.gitignore < = it’s a file where exception files or dirs are listed
index.html
css/
js/*j.s
Для private repositories нужно устанавливать ключ и записывать пароль.
git checkout b16c2b2 = > see how project looked
git checkout master = > come back
git revert 030673d = > cancel some commit
:wq to exit Vim
git reset 030673d = > deletes commit after id but saves files
git reset 030673d --hard = > deletes commit after id and changes files to the id selected
git branch forum = > creates a new branch
git checkout forum = > moving to another branch
git branch -a => show all branches
git checkout -b admin = > creates and goes to a new branch
git merge forum = > merges branch
git remote add origin https://github.com/gmashtalyar/gmashtalyar.ru.git = > add remote repo (GitHub)
git remote add origin git@github.com:gmashtalyar/gmashtalyar.ru= > push
git remote = > see remote
git push -u origin master
git clone https://github.com/gmashtalyar/gmashtalyar.ru.git
git push -u origin master
git pull
git pull git@github.com:gmashtalyar/gmashtalyar.ru.git
git ls-tree -r --name-only master