How to Push Local Repo Code into Github Repo

How to Push Local Repo Code into Github Repo

This guide is intended to show how to push code from our local computer to a GitHub repository.

Step 1

  • Open the Git Bash prompt and locate the folder that you want to push

Step 2

  • Initialize GitHub through the Git Bash prompt

git init        

Step 3

  • Use?the next command in your bash to add all the files to the given folder.

git add .        

Step 4

  • Use?the next command?in your bash to view all the files that are going to be staged to the first commit.

git status        

Step 5

  • Create a commit message that adds the change to the local repository.
  • Git commit uses the ‘-m’ flag for a message to set the commits with the content where the full description is included.

git commit - "your message"        

Step 6

  • The origin is the remote name, and the remote is the URL provided by your GitHub**.** You can see the remote as GitHub in this case, and GitHub provides the URL for adding to the remote repository.

git remote add origin 'git_url'        

Step 7

  • The below code is used for pushing local content to GitHub

git push -u origin master        

In case of error…

  • error: remote origin already exists.: This can be easily solved by just running the below code

git remote remove origin        

要查看或添加评论,请登录

Humberto Villalta的更多文章

  • Network Configuration

    Network Configuration

    Try the following steps to reset the server’s internet connection: Before Starting…. To see which file is connected to…

  • HDFS Clustering Through Docker in CentOS

    HDFS Clustering Through Docker in CentOS

    Overview This guide will show you how to deploy a distributed file system for Hadoop (HDFS). We will first make a…

  • Redis Integration with Python

    Redis Integration with Python

    Overview This guide is made for those who want to install Redis in a Centos 7 docker container and to integrate Python.…

  • What is Redis?

    What is Redis?

    Overview Redis is a C programming written REmote DIctionary Server developed in 2006. Redis read and write operations…

  • Linux [~/.bashrc] File

    Linux [~/.bashrc] File

    This post is intended to show how to interact with the different settings this file offers. Some of the settings that…

  • How to Set a Virtual Machine in Windows OS

    How to Set a Virtual Machine in Windows OS

    Overview Installing a virtual machine on a Windows operating system seems to be the easiest and most basic process that…

    2 条评论
  • Spacetime Data Hub Technology Connecting the Physical and Digital Worlds

    Spacetime Data Hub Technology Connecting the Physical and Digital Worlds

    The advancement of IT technology has enabled people to project physical spaces into virtual spaces known as “digital…

  • Python Decorator Introduction with Examples

    Python Decorator Introduction with Examples

    1. Overview The decorator pattern is a software design pattern that allows us to dynamically add functionality to…

  • HyperLogLog Basics

    HyperLogLog Basics

    Overview Probabilistic data structures are very well-known because of their outstanding time and space complexity among…

  • Cuckoo Index

    Cuckoo Index

    1. Overview Cuckoo hashing is used as a solution for hash collisions, and its worst-case lookup time is constant O(1).

社区洞察

其他会员也浏览了