repository:仓库
Git global setup:
git config --global user.name "Administrator" git config --global user.email "[email protected]"
Create Repository
mkdir document cd document git init touch README git add README git commit -m ‘first commit‘ git remote add origin [email protected]:root/document.git git push -u origin master
Existing Git Repo?
cd existing_git_repo git remote add origin [email protected]:root/document.git git push -u origin master
[[email protected] document]# git init Reinitialized existing Git repository in /media/6FE5-D831/git-data/local/document/.git/ [[email protected] document]# git add git-document.txt [[email protected] document]# git commit -m "firsh commit" # On branch master nothing to commit (working directory clean) [[email protected] document]# git remote add origin [email protected]192.168.1.103:root/document.git fatal: remote origin already exists. [[email protected] document]# git push -u origin master Counting objects: 3, done. Delta compression using up to 4 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 431 bytes, done. Total 3 (delta 0), reused 0 (delta 0) To [email protected]192.168.1.103:root/document.git * [new branch] master -> master Branch master set up to track remote branch master from origin.
时间: 2024-10-23 16:57:38