-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit.log
More file actions
51 lines (32 loc) · 1.19 KB
/
git.log
File metadata and controls
51 lines (32 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
http://www.liaoxuefeng.com/wiki/
========初始化仓库========
git init
=========end==============
=========github=============
1.创建ssh key: $ ssh-keygen -t rsa -C "youremail@example.com"
2.登陆GitHub,打开“settings”,“SSH and GPG Keys”页面:
3.关联远程仓:$ git remote add origin git@github.com:michaelliao/learngit.git
=========end===============
查看分支:git branch
创建分支:git branch <name>
切换分支:git checkout <name>
创建+切换分支:git checkout -b <name>
合并某分支到当前分支:git merge <name>
删除分支:git branch -d <name>
一、修改命令
git remote set-url origin url
二、先删后加
git remote rm origin
git remote add origin git@github.com:sheng/demo.git
三、修改config文件
如果你的项目有加入版本控制,那可以到项目根目录下,查看隐藏文件夹, 发现.git文件夹,找到其中的config文件,就可以修改其中的git remote origin地址了。
=====查看分支=======
git branch
======end========
=====删除分支=======
git branch -d zhizun
git branch -D zhizun (强制删除)
=======end==========
======查看远程分支========
git remote -v
=======end====== =====