Skip to content

How to push code to GitHub

How to push code to GITHUB
Share

Reading Time: < 1 minute

Git is a distributed version control system that tracks changes in any set of computer files, usually used for coordinating work among programmers collaboratively developing source code during software development. Its goals include speed, data integrity, and support for distributed non-linear workflows.

We assume you already have an existing repository in GIT and access to the particular repo.

Below steps will help you to How to push code to GitHub

How to push code to GitHub

GIT commands :

Open any ssh Terminal

Create ssh key :

ssh-keygen -t ed25519 -C Your-email-address
Note: Add this key on github.com to your account.

Validate connectivity with github.com for your account:
ssh -vT git@github.com

Create a directory
$ cd <mygitdir>

How to Clone git Repo :

git clone https://github.com/repo.git .

Create a branch, You can merge with Master once your code is tested. 
git branch OPS-100
git status
git branch
git checkout OPS-100
git status
cp file-path/file .
ls
git status
git add newfile-name
git commit -m "New File"
git config --global user.email Your-Email-Address
git push
git push --set-upstream origin OPS-100
Login to https://github.com/repo/pull/new/OPS-100
Add comments and do pull requests in Browser.

Conclusion

You can read more on GitHub website
If you are interested in Linux Articles, Please check


Share

Leave a Reply

Your email address will not be published. Required fields are marked *

?>