git config --global user.name "your_username"
git config --global user.email "[email protected]"
git config --global --list
Write user & password first time and along with this write below code that specify when timerout expires
git config --global credential.helper "cache --timeout=86400"
- Open the the local Git repo’s root folder
- Delete all of the files and folder in the Git repo’s root folder
- Delete the hidden .git folder with File Explorer or through the command line
- Run a git status command. A fatal: not a git repository error verifies that the Git repo is deleted
If you’re familiar with the terminal window or the DOS prompt, you can easily perform a command line Git repository delete. Just run the rm command with the -f and -r switch to recursively remove the .git folder and all of the files and folders it contains.
This Git repo remove command also allows you to delete the Git repo while allowing all of the other files and folder to remain untouched.
rm -fr .git
1. git pull --ff-only
2. git pull origin master
Your code uploaded to github
- click Code copy HTTPS LINKS
- Run
git clone <HTTPS LINK>
- Paste Your previous file Which not uploading to github
git push origin master
Your code uploaded to github
git log --oneline
git checkout <#code>
git log --oneline
git reset <#code> --hard
git revert <#code>
git branch
git branch -m <oldBranchName> <newBranchName>
git commit --amend -m "New commit message."
git status
sudo apt install gh
gh auth login
gh auth refresh -h github.com -s delete_repo
gh repo new/create <repo name> --public
--private
--internal
gh repo delete <repo name> --confirm
gh repo rename <new-repo-name>
When something change remote but not present locally and wanted to push my code to remote then this proble occurs
git push origin master -f
git pull origin master
git push origin master