Git command line

本文详细介绍了一系列Git基本操作命令,包括从远程仓库拉取代码、创建本地分支、切换分支、添加文件到暂存区、查看状态、提交更改、查看日志、查看特定提交的更改详情以及推送本地分支到远程仓库等步骤。

# Pull the repo from master

git pull

# Create branch for myself in local

git branch john/jenkins_code

# switch to myself branch of local

git checkout john/jenkins_code


# New file to wanted path and add the file to git branch

git add jenkins

# Get branch status

git status

# Commit changes to local branch ,, format git commit -a -m "<package name>: fix [bug number], comments for the changes"

git commit -a -m "intial file"


# Get log info

git log


# Get changes by changed id (changed id can be got from git log)

git show 00deef2edc1e03781bb2a578b81ce27ade46dfd

# Push local branch to origin

git push origin john/jenkins_code

 

转载于:https://www.cnblogs.com/root-wang/p/4414684.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值