Find the commit hash you want to go back to by git log --oneline
and then
git reset <commit_hash>
git reset
without a --hard
or --soft
moves your HEAD to point to the specified commit, without changing any files.
Find the commit hash you want to go back to by git log --oneline
and then
git reset <commit_hash>
git reset
without a --hard
or --soft
moves your HEAD to point to the specified commit, without changing any files.
If you see the bellow error for the first time when you try to push your new branch which has not been pushed:
git push
fatal: The current branch new-branch has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin new-branch
const formatedTimestamp = ()=> {
const d = new Date()
const date = d.toISOString().split('T')[0];
const time = d.toTimeString().split(' ')[0].replace(/:/g, '-');
return `${date} ${time}`
}
This example will show how to remove all Git branches in local except master branch
git branch | grep -v "master" | xargs git branch -D
{
"editor.fontSize": 13,
"editor.lineHeight": 24,
alias c='clear' | |
alias gs='git status' | |
alias pull='git pull' | |
alias push='git push' | |
alias master='git checkout master' | |
alias commit='git commit -m' | |
alias ll='ls -la' | |
alias ls='ls --color=auto' |
const validCreditCard = (cardNumber) => { | |
const newInput = cardNumber.toString(); | |
let first = 0; | |
let second = 0; | |
if (newInput.length !== 16) { | |
return false; | |
} | |
for (let i = 15; i >= 0; i--) { | |
if (i % 2 === 1) { |
After installing the main package as we need it for deploy:
npm i netlify-cli -g
Build the app with this command:
npm run build
After installing these two packages as we need them for deploy:
npm i now -g
npm i serve
follow these steps:
This one will only prompt the current directory
export PS1='\W > '
parse_git_branch() {