git --version
git init
git status
git log
git branch -d branch_name
git remote add origin https://abc.com/abc.git
- git log - view the history of commits
- git branch -d branch_name - delete a branch
- git remote add origin https://abc.com/abc.git - add a remote repository
git config user.name "Johnny test"
git add -A
git status -s
git status --short
git commit -a -m "Commit message"
But only works for files that are already tracked by Git. New files must be added first.
git help --all
git status --help
git branch hello-world-images
git branch
git checkout -b hello-world-images
git merge --abort
git branch -d hello-you
git remote add origin https://abc.com/abc.git
pull = fetch + merge
git pull origin master
git fetch origin
git merge origin/master
or simpler
git pull origin master
git pull origin
git push origin
git branch -a
git branch -r
git remote rename origin upstream
this will rename the origin remote to upstream
git remote show origin
*.temp
temp/*
*.log
!main.log
git remote add ssh-origin [email protected]:x/y.git
git remote set-url origin [email protected]:x/y.git
git log --oneline
git revert HEAD
git revert HEAD --no-edit
git revert HEAD~1 HEAD
git revert HEAD~2 HEAD~1 HEAD
git reset abc1234
git commit --amend -m "Updated index"
amend is used to change the last commit message