Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

how to initialize a git repository command line

# New local repository
git init
git add .
git commit -m "Initial commit"

# New remote repository
git remote add origin git@github.com:username/new_repo #ssh
# Now push
git push -u origin master
Comment

git initialize repository

echo "# covid19-tracker-app" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/shubhamghimire/covid19-tracker-app.git
git push -u origin main
Comment

initialize github repository

$git init
$git config --global user.email "your email"
$git config --global user.name "Your name"
$git remote add origin https://github.com/username/new_repo(Can be copied from github directly)
$git push -u origin master
Comment

create git repo

echo "# MachineLearning" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/ruChikati/MachineLearning.git
git push -u origin main
Comment

Create GIT repository

…or create a new repository on the command line
git init
git add .
git commit -m "first commit"
git remote add origin https://github.com/metinkaya1511/FinraDeck.git 
(GitHub’daki adres)
git push -u origin master
…push an existing repository from the command line
git remote add origin https://github.com/metinkaya1511/FinraDeck.git  
(github adresi)
git push -u origin master 
CREATE BRANCH
-   git branch develop ==> it creates new branch named 'develop' but still 
keep being on master branch
-   git checkout develop ==> it will change your branch to the develop branch
git checkout -b develop ==> it creates also a branch named develop and 
switches to it automatically
DELETE
git branch -d <branch_name> deletes the branch. If we have unmerged changes, 
this command gives a warning and does not delete.  
git branch -D <branch_name> deletes the branch even if it has unmerged changes.
Gives no warning.
SWITCH to Branch
git checkout develop checks out the branch, switches to the branch.
git checkout -b <branch_name> creates a new branch and switches to it.  
git merge <branch_name>  this command takes changes from the given branch, 
and merges with the current branches we are on. 
Comment

create new git repository

echo "# backend" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin git@github.com:igc-fashion/backend.git
git push -u origin main
Comment

PREVIOUS NEXT
Code Example
Shell :: unrachive .tar.gz 
Shell :: npm install package as developer dependency 
Shell :: search file in ubuntu 
Shell :: install vlc rhel 
Shell :: git initial commands 
Shell :: vscode save git credentials 
Shell :: git push specify ssh key 
Shell :: rot13 in bash 
Shell :: how to pull the changes from git without staging local changes 
Shell :: windows scan for corrupt files 
Shell :: pip install google trans 
Shell :: remove spaces from file names bash 
Shell :: make current branch master 
Shell :: install ionic 6 
Shell :: gitflow install linux 
Shell :: vendor/autoload.php download 
Shell :: ubuntu echo create file readme.md 
Shell :: nginx remove x-powered-by 
Shell :: how to generate keystore file for cordova 
Shell :: how to add image in readme.md 
Shell :: kubectl top pod 
Shell :: vlc for ubuntu 
Shell :: where is wsl folder in windows 
Shell :: install activitywatch ubunut 
Shell :: how to config username and email in git 
Shell :: how to uninstall a aur package 
Shell :: grep remove duplicates 
Shell :: change branch from master to main 
Shell :: change local branch name 
Shell :: how to remove non empty dircetory 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =