git指令

下載git server trunk
git clone git@gitserver:/opt/git/project.git

如何將檔案提交(commit)

使用 git commit會將 Stage 狀態的檔案做 Commit 動作
git commit -m "commit訊息" 可以略過編輯器直接輸入 commit 訊息完成提交。
git commit -am "commit訊息" 等同於先git add .後略過編輯器提交 commit。

git push 類似於 pull 操作,將本地端的 branch 上傳到遠端。

Push - 將 Commit 送出去

git push 或 git push origin master
實際的作用是將本地端的 master branch 與遠端的 master branch 作 fast-forward 合併。如果出現 [rejected] 錯誤的話,表示你必須先作 pull。

git add modify-file # 修改過的檔案, 也要 add. (不然 commit 要加上 -a 的參數)

Git Commit

git commit
git commit -m 'commit message'
git commit -a -m 'commit -message' # 將所有修改過得檔案都 commit, 但是 新增的檔案 還是得要先 add.
git commit -a -v # -v 可以看到檔案哪些內容有被更改, -a 把所有修改的檔案都 commit

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值