新建branch,commit change, push to remote
$ mkdir branch
$ cd branch/
$ git init
$ git clone https://gitlab-master.xxx.com/xxx/prelabel.git
Cloning into 'prelabel'...
Username for 'https://gitlab-master.xxx.com': <fill your name>
Password for 'https://yourname@gitlab-master.xxx.com': <my pc passwd>
remote: Enumerating objects: 28, done.
remote: Counting objects: 100% (28/28), done.
remote: Compressing objects: 100% (25/25), done.
remote: Total 28 (delta 10), reused 0 (delta 0)
Unpacking objects: 100% (28/28), done.
$ cd prelabel/
$ git log
$ git checkout -b polyline #create a new branch, name is polyline
$ vim label2sqlite.py
$ git add label2sqlite.py
$ git status
$ git commit
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got 'yourname@szdl.(none)')
$ git config --global user.email "yourname@xxx.com"
$ git config --global user.name "yourname"
$ git commit
[polyline b8398e7] Add two funtions
1 file changed, 44 insertions(+)
Note: ctrl+X 退出
$ git log
commit b8398e72cc324a211dc55ee65c97a46e7c67edfc (HEAD -> polyline)
Add two funtions
commit a199df81135db5295b714be894929fe09772c140 (origin/master, origin/HEAD, master)
Add PARTITION
commit ccb86dd839d74e6a4e7c2c7fda01a0c3da94c9d8
Add status
$ git branch
master
* polyline
$ git branch -a
master
* polyline
remotes/origin/HEAD -> origin/master
remotes/origin/master
$ git push origin polyline:polyline
(本地分支:远程分支)(https://www.jb51.net/article/111493.htm)
Username for 'https://gitlab-master.xxx.com': <fill your name>
Password for 'https://yourname@gitlab-master.xxx.com':
Counting objects: 3, done.
Delta compression using up to 12 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 556 bytes | 556.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote:
remote: To create a merge request for polyline, visit:
remote: https://gitlab-master.xxx.com/xxx/prelabel/merge_requests/new?merge_request%5Bsource_branch%5D=polyline
remote:
To https://gitlab-master.xxx.com/xxx/prelabel.git
* [new branch] polyline -> polyline
$ git log
commit b8398e72cc324a211dc55ee65c97a46e7c67edfc (HEAD -> polyline, origin/polyline)
Add two funtions
commit a199df81135db5295b714be894929fe09772c140 (origin/master, origin/HEAD, master)
Add PARTITION
commit ccb86dd839d74e6a4e7c2c7fda01a0c3da94c9d8
Add status
$ git branch -a
master
* polyline
remotes/origin/HEAD -> origin/master
remotes/origin/master
remotes/origin/polyline 比之前的git branch 多了这个, 因为从本地branch push到了remote branch
https://www.cnblogs.com/chechen/p/9950798.html
https://www.cnblogs.com/Z-xl/p/6142455.html
https://www.jb51.net/article/111493.htm
https://docs.gitlab.com/ce/workflow/gitlab_flow.html
https://docs.gitlab.com/ee/gitlab-basics/start-using-git.html