Jul 11, 2023

[Git hub] command guideline

### initialize and start a git

# git init


### Setting account information

# git config -global user. "abcd "

# git config -global user.email "abcd@abcd.com"


### confirm a config list 

# git config --list


### current state

# git status


### adding files to the staging area

# git add . # whole files


### commit

# git commit -m "abcd"

# git commit -m "abcd" --amend # revise the commit


### confirm the commit logs

# git log


### connect between local and remote

# git remote add origin [git hub adress]


### confirm the current configured remote repository

# git remote -v


### push the local soruce to the remote repository

# git push origin master

# git push origin [new_branch] # create a new_branch in remote repository and push


### create a branch

# git branch [name]


### move to the branch

# git checkout [name]

# git checkout -b [name] # create a branch and move to the branch simultaneously


### delete the branch

# git branch -d [name]


### pull the code of the master of the remote

# git pull origin master

No comments:

Post a Comment