Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

how to push local code to git repository

Create a new repository on the command line
git init
git add .
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/neetigyachahar/codebox.git
git push -u origin main
Comment

How to create a local repository and push to github repository

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

how to push local repo to github

/*
|==================================================================
| How to init and push local repository code to remote (github)
|==================================================================
*/

STEP-1 (Initialize git ropository on local machine)
git init

STEP-2 (add all file to local git repo)
git add .

STEP-3 (commit your code to local repo)
git commit -m "first commit"

STEP-4 (select branch)
git branch -M main

STEP-5 (add remote address to local git repo)
git remote add origin https://github.com/Shahzad-Mahota/test-project

STEP-6 (push code to remote)
git push -u origin main
Comment

how to push local code to git repository

--::-- Using SSH --::--
#### Create SSH key ####
$ ssh-keygen -t ed25519 -C "<YourEmail>@<Domain>.com"

#### Copy the SSH key ####
$ cat /path/to/private_key_file.pub

#### Add the SSH key to your GitHub account ####

$ echo "# myPracticeRepo" >> README.md
$ git init
$ git add README.md
$ git commit -m "first commit"
$ git branch -M main
$ git config core.sshCommand 'ssh -i /path/to/private_key_file'
$ git remote add origin git@github.com:<UserName>/<RepoName>.git
$ git push -u origin main


--::-- Using HTML --::--
$ echo "# myPracticeRepo" >> README.md
$ git init
$ git add README.md
$ git commit -m "first commit"
$ git branch -M main
$ git remote add origin https://github.com/<UserName>/<RepoName>.git
$ git push -u origin main
Comment

PREVIOUS NEXT
Code Example
Shell :: ubuntu server set timezone 
Shell :: untar gz 
Shell :: failed to start daemon: pid file found, ensure docker is not running or delete /var/run/docker.pid 
Shell :: sudo apt-get -y install postgresql 
Shell :: conda create enviroment from file 
Shell :: find cuda path 
Shell :: bash find all files containing string 
Shell :: how to see the origin in git 
Shell :: ubuntu fingerprint sudo 
Shell :: docker command to find jenkins password 
Shell :: kill service by port number on windows 
Shell :: git create new tag 
Shell :: pip access denied 
Shell :: installing mailcatcher ubuntu 
Shell :: install pip anacodna 
Shell :: brew install notion 
Shell :: count files in a directory 
Shell :: convert to uppercase command awk 
Shell :: Installing qt ubuntu 
Shell :: install github desktop ubuntu 
Shell :: how to remove windows service 
Shell :: E: Unable to locate package libboost-signals-dev 
Shell :: how to remove file changes in git 
Shell :: tmux how to scroll in history 
Shell :: reverse shell bash 
Shell :: install pygraphviz 
Shell :: streamlink save file 
Shell :: how to install cmatrix 
Shell :: uninstall tensorflow colab 
Shell :: pip installer for mac 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =