echo "# error-handling" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/bijay-shrestha/error-handling.git
git push -u origin master
Follow this link
echo '.idea' >> .gitignore
git rm -r --cached .idea
git add .gitignore
git commit -m '<write some message stating the file is removed>'
git push
$ git reset --hard <commidId> && git clean -f
$ git push --delete <remote_name> <branch_name>
$ git branch -d <branch_name>
Note that in most cases the remote name is origin
.
Use the git remote rm
command to remove a remote URL
from your repository.
The git remote rm
command takes one argument:
A remote name, for example, destination
$ git remote -v
# View current remotes
> origin https://github.com/OWNER/REPOSITORY.git (fetch)
> origin https://github.com/OWNER/REPOSITORY.git (push)
> destination https://github.com/FORKER/REPOSITORY.git (fetch)
> destination https://github.com/FORKER/REPOSITORY.git (push)
$ git remote rm destination
# Remove remote
$ git remote -v
# Verify it's gone
> origin https://github.com/OWNER/REPOSITORY.git (fetch)
> origin https://github.com/OWNER/REPOSITORY.git (push)
git pull origin master --allow-unrelated-histories
git branch -m new-name
git update-index --assume-unchanged <file>
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
If you are on the branch you want to rename:
git branch -m new-name
If you are on a different branch:
git branch -m old-name new-name
git push origin :old-name new-name
Switch to the branch and then:
git push origin -u new-name