Git Basics
git init - init new repo git status - get info git add filename -add file git add '*.txt' - add files by mask
git add -p - move all changes in directory to next commit git commit -m "some fucking comment" -move changes to repo git log - commit log git remote add remote_repo_name remote_repo_url - add remote repo like github git push -u remote_repo_name user_name - push to remote repo git pull remote_repo_name user_name - get new changes git diff HEAD - difference between out last commit and current situation git reset filename unstage file git checkout -- file_name - change the file back to the last commit state git branch branch_name - create new branch git checkout branch_name - switch between branches git rm '*.txt' - remove and unstage files git merge branch_name - merge branches git branch -d brach_name - delete branch
git branch -a - show all branches in repo(remote and local)
git branch -r - show remote branches only
git rebase -i HEAD~4 -in intaractive mode change last four commits
# Undo changes in tracked files
git reset --hard
# Remove untracked files
git clean -df
reset all changes to last commit state
git remote -v - show remote repos
git config remote.origin.url https://{USERNAME}:{PASSWORD}@github.com/{USERNAME}/{REPONAME}.git -save GitHub credentials














