I need:
- Creat accoutn on https://github.com
- Creat first Repository(privat)
- Creat ssh key on github for autorization link
-
ssh-keygen -t ed25519 -C "Адрес электронной почты защищен от спам-ботов. Для просмотра адреса в вашем браузере должен быть включен Javascript."
chmod =600 ~/.ssh/id_ed25519
-
cat /root/.ssh/id_ed25519.pub
- Add to github
-
- Push out code to github
- Add sing
-
git config --global user.email "Адрес электронной почты защищен от спам-ботов. Для просмотра адреса в вашем браузере должен быть включен Javascript."
-
git config --global user.name "KSI"
-
- cd our directory
-
cd git-upload/
-
- git init
-
git init or git add --all :/
-
git commit -m "first commit"
-
-
git add .
- add remote git
-
For http with PAT key(you have to create PAT key in github repo) {originKSI} alias for repo git remote add originKSI https://sergharkov:Адрес электронной почты защищен от спам-ботов. Для просмотра адреса в вашем браузере должен быть включен Javascript./sergharkov/ELG.git or update git remote set-url originKSI https://sergharkov:Адрес электронной почты защищен от спам-ботов. Для просмотра адреса в вашем браузере должен быть включен Javascript./sergharkov/ELG.git For ssh with ssh pub key: git remote add origin Адрес электронной почты защищен от спам-ботов. Для просмотра адреса в вашем браузере должен быть включен Javascript.:sergharkov/myrepository.git
- show list -- >
git remote -v
-
git pull -u origin master
- edit some file
-
git add . (or git add {link to file} )
-
git commit -m "comit comment"
-
git push origin master or (git push {link REPO} {name brach})
-
- Add sing
- Clear commits before PR(for example)
-
git log git rebase -i HEAD~3 #where 3 -- 3 last commit all commit you can see by command git logs
After for you opened dialog for action with commits, I reccomends first set
p, pick = use commit-
p, pick = use commit
- other
-
s, squash = use commit, but meld into previous commit
-
- After opened dialog with editor text of commit -- I reccomend clearing all merge text of previouse commits
-
git push -f
-
- Some needed commands(describe): link
-
№ commands describe git log --oneline --graph --decorate --all красивый удобный вывод git pull git fetch + git merge git fetch origin стягивает изменения с репозитория под алиасом origin git merge origin master обединяет(сливает) изменения с текущей локальной ветки HEAD в локальную ветку origin master git push origin master заливает локальные изменения на репозиторий git branch проверить текущий бранч git checkout {Name_Branche} переключиться в новый бранч git branche {New_Name_Branche} создать новый бранч git branche -m {New_Name_Branche} переименовать текущий бранч git branch --delete <branchname>
delete branch localy git reset --hard origin/{branch}
перезатрет локальные изменения git config --global credential.helper store save passwords git log --oneline --all --graph show in good view git cherry-pick --continue resolv conflict commits -
https://rtfm.co.ua/wp-content/uploads/2016/02/Git-Cheat-Sheet.png
-