git建立分支

1、在你的项目里面右键选择Git Bash Here打开黑窗口

git clone x (x为git仓库链接)

2.在idea中新建分支并上传代码(在此处输入指令)

//1.新建分支
git branch xxx (xxx填写你的分支名称)

//2.查看所有分支
git branch -a

//3.切换到某一分支
git checkout xxx (xxx填写要切换的分支名称)

//4.添加修改代码到缓存(注意最后的"."前面有个空格)
git add .

//5.添加提交代码的备注
git commit -m "xxx" (xxx为本次提交代码的备注)

//6.提交代码到指定分支
git push origin xxx (xxx为要提交代码的分支名称)


//7.成功
C:\Users\Administrator\Desktop\demo>git branch one

C:\Users\Administrator\Desktop\demo>git branch -a
* master
  one
  remotes/origin/master

C:\Users\Administrator\Desktop\demo>git checkout one
Switched to branch 'one'

C:\Users\Administrator\Desktop\demo>git add .

C:\Users\Administrator\Desktop\demo>git commit -m "one"
On branch one
nothing to commit, working tree clean

C:\Users\Administrator\Desktop\demo>git push origin one
Enumerating objects: 23, done.
Counting objects: 100% (23/23), done.
Delta compression using up to 8 threads
Compressing objects: 100% (8/8), done.
Writing objects: 100% (12/12), 893 bytes | 893.00 KiB/s, done.
Total 12 (delta 5), reused 0 (delta 0)
remote: Powered by GITEE.COM [GNK-6.2]
remote: Create a pull request for 'one' on Gitee by visiting:
remote:     https://gitee.com/liu1-liu1/demo/pull/new/liu1-liu1:one...liu1-liu1:master
To https://gitee.com/liu1-liu1/demo.git
 * [new branch]      one -> one

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值