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

Git Code Push

git remote add origin https://github.com/shmahee/Marvel.git
git branch -M main
git push -u origin main
Comment

push to git

$ git init -b main

$ git add .
# Adds the files in the local repository and stages them for commit. To unstage a file, use 'git reset HEAD YOUR-FILE'.

$ git commit -m "First commit"
# Commits the tracked changes and prepares them to be pushed to a remote repository

$ git remote add origin  <REMOTE_URL> 
# Sets the new remote
$ git remote -v
# Verifies the new remote URL

$ git push origin main
# Pushes the changes in your local repository up to the remote repository you specified as the origin
Comment

how to push git

# its not master anymore, its main

git push -u origin main //then login w/ your creds
Comment

git push to create

git push --set-upstream git@gitlab.example.com:namespace/myproject.git master
Comment

git push command

git add .
git commit -m "your message"
git push
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 :: git rename file 
Shell :: how to remove user from the group 
Shell :: add user to sudoer 
Shell :: intel driver arch linux 
Shell :: install cassandra 
Shell :: git see tags 
Shell :: check current branch github 
Shell :: create virtual environment anaconda 
Shell :: how to upgrade in linux 
Shell :: error TS1056 
Shell :: flutter plugin installed but in flutter doctor it shows not installed 
Shell :: copy from remote to local 
Shell :: snap install slack 
Shell :: heroku pg kill 
Shell :: debian full install qt5 
Shell :: git check which files are committed 
Shell :: how to open text editor in git bash 
Shell :: aac anticheat 
Shell :: install fdupes duplicate content finder on linux 
Shell :: gitignore io 
Shell :: node_modules missing did you mean to install 
Shell :: vuforia git url 
Shell :: soundcloud for ubuntu install command 
Shell :: vscode kali linux 
Shell :: docker compose rebuild image 
Shell :: pipenv install flask 
Shell :: git remove untracked branches 
Shell :: how to enable the Visual Studio Code GitHub Support and set a Personal Access Token 
Shell :: docker image convert to tar.gz 
Shell :: moving files in terminal 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =