Useful commands to amend author and committer information.
First, basics. Setting user name and email:
# local, for project level
git config user.name "Kanan Rahimov"
git config user.email mail@kenanbek.me
# global
git fetch --all | |
git reset --hard origin/master | |
git pull |
# parse the command-line arguments | |
while getopts ":nh" opt; do | |
case ${opt} in | |
h) | |
echo "Usage:" | |
echo " git-clone.sh [-n]" | |
echo "" | |
echo "Options:" | |
echo " -n Skip commit and push" | |
exit 0 |
# This .gitignore file should be placed at the root of your git repository directory | |
# | |
# You might have as many sub-projects as you want and this configuration will ignore project specific unnecessary files | |
# | |
[Ll]ibrary/ | |
[Tt]emp/ | |
[Oo]bj/ | |
[Bb]uild/ | |
[Bb]uilds/ | |
[Ll]ogs/ |
## | |
# Sync with upstream | |
### | |
# add upstream | |
git remote add upstream <git_remote_url> | |
# fetch changes | |
git fetch upstream |
# rename | |
git branch -m new-name # option 1: when renaming the current branch | |
git branch -m <current_branch_name> <new_branch_name> # option 2: when renaming another branch | |
# delete old branch | |
git push origin -d <old_branch_name> # option 1 | |
git push origin :<old_branch_name> # option 2 (shorter) | |
# unset upstream | |
git branch --unset-upstream <new_branch_name> |
package main | |
import ( | |
"fmt" | |
"flag" | |
"io/ioutil" | |
"gopkg.in/yaml.v2" | |
) | |
// YamlConfig is exported. |
{ | |
"scripts": { | |
"dev": "next dev", | |
"build": "next build", | |
"start": "next start" | |
}, | |
"dependencies": { | |
"next": "^10.0.1", | |
"react": "^17.0.1", | |
"react-dom": "^17.0.1" |
function HomePage() { | |
return ( | |
<div> | |
<h1>Hello, Next.js!</h1> | |
<p>Next.js quick start tutorial with manual setup.</p> | |
<img src="/image1.png" /> | |
</div> | |
); | |
} |
const express = require('express'); | |
const app = express(); | |
//const hostname = '127.0.0.1'; | |
const port = 3000; | |
app.get('/', (req, res) => { | |
let body = { | |
"message": "Hello, world!", |