https://github.com/takbirgazi/important
Explore our daily-use code snippets and tools conveniently stored in this repository's README. Dive into practical examples and utilities we rely on regularly
https://github.com/takbirgazi/important
cmd express git github javascript mysql node php react
Last synced: 3 months ago
JSON representation
Explore our daily-use code snippets and tools conveniently stored in this repository's README. Dive into practical examples and utilities we rely on regularly
- Host: GitHub
- URL: https://github.com/takbirgazi/important
- Owner: takbirgazi
- Created: 2024-06-05T12:06:45.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-12-19T06:49:38.000Z (6 months ago)
- Last Synced: 2026-01-03T14:24:33.838Z (6 months ago)
- Topics: cmd, express, git, github, javascript, mysql, node, php, react
- Homepage:
- Size: 96.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Important Code for daily use
## Git Commands
* Check Git Configuration:
``` git config --list ```
* Add user name:
``` git config --global user.name "your user name" ```
* Add user email:
``` git config --global user.email "yourname@email.com" ```
* Set a default branch to main:
``` git config --global init.defaultBranch main ```
* Add:
``` git add . ```
* Reset From Add .:
``` git reset ```
* Commit:
``` git commit -m "Messages" ```
* Push First Time To Main Branch:
``` git push -u origin main ```
Next Time:
``` git push ```
* Remove The Last Commit
``` git reset --soft HEAD~1 ```
* Pull Existing Project
``` git pull ```
* Pull from Other Branch
``` git pull origin branchname ```
* Check Remote Repository
``` git remote -v ```
* Add Remote Repository
```git remote add origin https://github.com/username/repository_name.git```
* Change Remote Repository
``` git remote set-url origin https://github.com/username/new_repository_name.git ```
* Remove Remote Repository
```git remote remove origin```
* Push Forcefully Existing Branch like main
``` git push -f -u origin main ```
* Check Status:
``` git status ```
* Check Status with time:
```
for f in $(git status --porcelain | awk '{print $2}'); do
stat -c "%y %n" "$f"
done
```
* Check Origin
``` git remote show origin ```
* Clone with default branch
``` git clone https://github.com/username/repository_name.git ```
* Clone with specific branch
``` git clone -b branchname https://github.com/username/repository_name.git ```
* Switch an existing branch
``` git checkout branchname ```
* Create and Switch a new branch with the current branch code
``` git checkout -b newbranchname ```
* Check branch
``` git branch ```
* Delete a branch (safe)
``` git branch -d branchname ```
* Delete a branch (force)
``` git branch -D branchname ```
* Delete a branch Remote
``` git push origin --delete branchname ```
* Remove Untracked Data
``` git stash ```
* Branch Merging
``` git merge branchname ```
* Remove Director from git
``` git rm -r directoryname ```
* Remove .env from git
``` git rm --cached --ignore-unmatch .env ```
*Find your password to pull your private repository*
* Log In to Your GitHub Account
* Go to Profile And Click Settings
* Click Developer settings
* Select Tokens (classic) at Personal access tokens
* Select Generate new token (classic) at Generate new token
* Check All And Click the Generate token Button.
* Copy The Token. That is your Password.