当前位置: 首页 > news >正文

linux github 仓库管理常用操作

linux 的常用操作

  1. linux 本地 ssh验证连接github账号
  2. 本地仓库连接远程私有仓库
  3. push/pull操作

Connecting to Github with ssh

  1. git local configuration
    If you are using git for the first time, configure the user name and email in the device.
git config --global user.name "username"
git config --global user.email "useremail@xx.xx"
  1. add a ssh key
cd ~/.ssh/
ls -al ./ # check if existing SSH keys are present 
ssh-keygen  # else, generating
cat ~/.ssh/xxx.pub

add a new ssh key :https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account

Connect and pull files from private repo

Prerequisites: you must have already been connected with your github account.
You can git clone private repo by ssh directly.

Connect and push files to private repo

Prerequisites: you must have already been connected with your github account.

  1. git push a file from local to remote
    The local device must already be connected with your github account before using the following the commands.
mkdir someDir  # mkdir to connect with remote repo
echo "# something for testing" >> README.md
git init
git add README.md
git commit -m "Test the first commit"
git branch -M main
git remote add origin git@github.com:user/repo-name.git
git remote -v  # check the remote state
git push origin main

Pull

git pull origin main # git pull remote_repo local_repo

Push file

git add yourfile
git commit -m "comment about yourfile"
git push origin main # git push remote_repo local_repo 
http://www.lryc.cn/news/127177.html

相关文章:

  • IT运维:使用数据分析平台监控深信服防火墙
  • 深入解析 Axios Blob 的使用方法及技巧
  • 爬虫逆向实战(十三)--某课网登录
  • 4.SpringCloud
  • OLED透明屏采购指南:如何选择高质量产品?
  • 机器学习编译系列
  • MySQL 数据库巡检系统的设计与应用
  • 工程项目管理系统源码+功能清单+项目模块+spring cloud +spring boot em
  • 前端笔试+面试分享
  • C Language Handout
  • 数据结构——栈(C语言)
  • Linux 内核内存管理 page_address 函数
  • macOS使用ffmpeg与QT进行音视频推拉流
  • ARTS打卡:双指针的尝试
  • JavaWeb-DAO设计模式
  • 重温git和GitHub
  • C# WPF 中 外部图标引入iconfont,无法正常显示问题 【小白记录】
  • Hi-TRS:骨架点视频序列的层级式建模及层级式自监督学习
  • FPGA 之 xilinx DDS IP相位控制字及频率控制字浅析
  • [鹏城杯 2022]简单包含
  • Required request parameter ‘XXX‘ for method parameter type XXX is not present问题
  • centOS 快速安装和配置 NVIDIA docker Container Toolkit
  • 编程练习(2)
  • 利用Figlet工具创建酷炫Linux Centos8服务器-登录欢迎界面-SHELL自动化编译安装代码
  • Git Cherry-pick使用
  • 红帽8.5 ansible 安装和部署 |(简单版)
  • Visual Studio 2019 c++ 自定义注释 ----doxygen
  • 面试题. 零矩阵
  • 易语言下载器
  • 原生js获取今天、昨天、近7天的时间(年月日时分秒)