git 基本命令 (常用)

时间:2023-03-09 07:13:12
git 基本命令   (常用)
 http://www.zhixing123.cn/ubuntu/37865.html    参考的这个网址

他这里有个错误:id_rsa.pub  应该复制这个 而不是id_rsa

 1341  git init
 1342  git add README.md
 1343  git commit -m "first commit"
 1344  git remote add origin git@github.com:tidalmelon/seven.git
 1345  git push -u origin master 2132  git init
 2133  git add .
 2134  git commit -m "first commit"
 2135  git remote add origin git@github.com:tidalmelon/cutvegetables.git
 2136  git push -u origin master 平时提交
git status
git add -A
git commit -m 'message'
git push 修改或添加文件了怎么办么?
 2066  git commit -m 'modify question.py'
 2067  git push -u origin master
root@localhost:/home/projects/cutvegetables# git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# new file: myoa/daily/--.txt
# new file: myoa/daily/--.txt
# modified: myoa/question.py
oot@localhost:/home/projects/cutvegetables# git commit -m 'modify question.py'
[master 80a1c93] modify question.py
files changed, insertions(+), deletion(-)
create mode myoa/daily/--.txt
create mode myoa/daily/--.txt
oot@localhost:/home/projects/cutvegetables# git push -u origin master
Counting objects: , done.
Delta compression using up to threads.
Compressing objects: % (/), done.
Writing objects: % (/), bytes, done.
Total (delta ), reused (delta )
To git@github.com:tidalmelon/cutvegetables.git
1b18e18..80a1c93 master -> master
Branch master set up to track remote branch master from origin.
root@localhost:/home/projects/cutvegetables#
在另外一台电脑上将代码拉下来:
[root@slave2 cutvegetables]# git pull origin
remote: Counting objects: , done.
remote: Compressing objects: % (/), done.
remote: Total (delta ), reused (delta )
Unpacking objects: % (/), done.
From github.com:tidalmelon/cutvegetables
1b18e18..80a1c93 master -> origin/master
Updating 1b18e18..80a1c93
Fast-forward
myoa/daily/--.txt | ++++++++
myoa/daily/--.txt | ++++++++
myoa/question.py | +-
files changed, insertions(+), deletions(-)
create mode myoa/daily/--.txt
create mode myoa/daily/--.txt
今天的新情况,

我在两个客户端都改了代码,这怎么办?
答案:
先Push一个上去 然后fetch到另一台电脑的本地 Merge