首页 > 其他分享 >Git 常用命令行

Git 常用命令行

时间:2022-08-22 15:47:59浏览次数:75  
标签:origin git -- add Git 常用命令 config

Git设置:

-- Gitlab 公司账号
git config --global user.name "***"
git config --global user.email "g**@nan**.com"

-- Github 个人账号
git config --local user.name 'githubname'
git config --local user.email 'github邮箱'

创建一个新仓库(Github 为例)

git clone gitlab@120.**.**.122:sk/report.git
cd report
git switch -c master
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master

推送现有文件夹(Github 为例)

cd existing_folder
git init --initial-branch=master
git remote add origin gitlab@120.**.**.122:sk/report.git
git add .
git commit -m "Initial commit"
git push -u origin master

推送现有的Git仓库(Github 为例)

cd existing_repo
git remote rename origin old-origin
git remote add origin gitlab@120.**.**.122:sk/report.git
git push -u origin --all
git push -u origin --tags

 

标签:origin,git,--,add,Git,常用命令,config
From: https://www.cnblogs.com/xiaobaidejiucuoben/p/16612974.html

相关文章

  • Maven常用命令和Maven生命周期
    Maven常用命令常用命令为:mvnarchetype:create:创建Maven项目mvncompile:编译源代码mvntest-compile:编译测试代码mvntest:运行应用程序中的......
  • Maven标准目录结构以及Maven的常用命令
    Maven标准目录结构   maven项目标准目录结构src/main/java目录:核心代码部分src/main/resources:配置文件部分src/test/java目录:测试代码部分src......
  • 关于使用Git不能拉取GitLab https项目地址的问题
    现在使用Git命令直接clonehttps://xxx项目时候会报错“没有权限拉取代码”,其实我们需要在“UserSettings ---》AccessTokens“界面新增一个 accesstoken就好了,......
  • Windows环境下IDEA配置SSH Key访问Gitlab源代码仓库
    使用Gitlab管理项目时,project在创建的时候只能选择“Public”公开状态,Private和Internal私有模式下不能使用http方式进行连接。(ssh方式在三种模式下都可以)。使用http方式直......
  • Redis命令操作_常用命令和Redis持久化
    通用命令keys*查询所有的键typekey:获取键对应的value的类型delkey:删除指定的keyclear:清除窗口所有内容127.0.0.1:6379>keys*(emptylistorset)127.0.0.1:......
  • 搭建Github图床
    准备一个GitHub账号,下载PicGo:链接1、新建github仓库新建GitHub仓库,注意仓库要设置成公开2、生成一个token密钥3、下载PicGo、配置在这里(opensnewwind......
  • 解决github推送错误 remote: Support for password authentication was removed on Au
    推送github仓库代码,输入完账号密码出现:remote:SupportforpasswordauthenticationwasremovedonAugust13,2021.remote:Pleaseseehttps://docs.github.com/en/......
  • linux suse非常用命令
    【1】suselinux查询端口占用情况查询$netstat-anp|grep:22tcp000.0.0.0:220.0.0.0:*LISTEN1666/sshd#-a显示所有活动的TCP连接,以及正在监听的TCP和UDP端......
  • 使用 Docker 搭建 gitea 私有仓库
    一、准备材料安装环境:linux工具:docker软件:MySql、gitea二、安装Docker安装Docker:https://www.cnblogs.com/jzcn/p/15693786.html三、下载镜像使用DocKer下载Mysq......
  • Redis常用命令
    1、查询redis进程ps-ef|grepredis 2、进入redis客户端命令redis-cli-h127.0.0.1-p6379#如果设置了密码:127.0.0.1:6379>auth123456 3、查询redis......