This example will show how to remove all Git branches in local except master branch
git branch | grep -v "master" | xargs git branch -D
const formatedTimestamp = ()=> {
const d = new Date()
const date = d.toISOString().split('T')[0];
const time = d.toTimeString().split(' ')[0].replace(/:/g, '-');
return `${date} ${time}`
}
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