•安裝
yum install git
git config //git配置修改
•linux中建立pub key,匯入github
•git init 建立新專案並上傳(或者git clone)
•建立新檔案,
git add
•git commit
•git push
兩項基本配置:
#配置使用
git倉庫的人員姓名
git config --globaluser.name 「mike"
#配置使用
git倉庫的人員email
git config --global [email protected]
本地無專案是這樣操作(與clone有點區別):
#
初始化乙個版本倉庫
git init
cd existing_folder
git init
git remote add origin git@dx2:kennethxian/testproject.git
//remote add重新命名指令
git add .
git commit
git push -u origin master
遇到的錯誤以及解決辦法:
[root@hty-1 sortedpricename]# git push
to [email protected]:crazyyanchao/sortednmaeprice.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to
'[email protected]:crazyyanchao/sortednmaeprice.git'
to prevent you from losing history, non-fast-forward updates were rejected
merge the remote changes before pushing again. see the 'note about
fast-forwards' section of
'git push --help'
for details.
以上報錯通過更新本地倉庫解決,之後重新提交ok!
you asked to pull from
the remote 'origin', but did not specify
a branch. because this is
notthe default configured remote
for your current branch, you must specify a branch on
the command line.
[root@hty-1 sortedpricename]# git pull origin master
from github.com:crazyyanchao/sortednmaeprice
* branch master -> fetch_head
merge made by recursive.
readme.md | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
create mode 100644 readme.md
專案提交git
已經有了乙個正在開發的專案,現在我們要把他分享到git osc上面去。1.第一步,先在git osc上建立倉庫,拿到git osc倉庫的http連線 2.如果本地專案是非git專案,那先把它變成git專案 在intellij中 vcs import into version control crea...
Git 本地提交
1.本地增加檔案 git add filename 2.本地刪除檔案 git rm filename git rm r dirname 和rm 的區別是,如果使用rm刪除會將刪除該檔案的操作提交上去 直觀的來講,git rm 刪除過的檔案,執行 git commit m abc 提交時,會自動將刪除...
git提交問題
公司用sourcetree,我自己的檔案放在github上,今天提交git的時候出現錯誤 fatal authentication failed for 參照網上修改 git config global user.name git config global user.email com 後仍然無效...