git 在原来的本地仓库上添加远程仓库地址并push到服务器

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/hknaruto/article/details/88057346
[yeqiang@localhost djangoproj]$ git init .
[yeqiang@localhost djangoproj]$ vim .gitignore
[yeqiang@localhost djangoproj]$ git status 
On branch master

Initial commit

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	.gitignore
	app1/
	app2/
	db.sqlite3
	djangoproj/
	manage.py
	nginx.conf
	pid.uwsgi
	readme.html
	templates/
	test.py
	uWSGI.ini

nothing added to commit but untracked files present (use "git add" to track)
[yeqiang@localhost djangoproj]$ git add .gitignore 
[yeqiang@localhost djangoproj]$ git add *
The following paths are ignored by one of your .gitignore files:
uWSGI.log
uWSGI.pid
Use -f if you really want to add them.
[yeqiang@localhost djangoproj]$ git status 
On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)
	

[yeqiang@localhost djangoproj]$ git commit -m "firest commit"
[master (root-commit) b4079f1] firest commit
 67 files changed, 1634 insertions(+)
 
[yeqiang@localhost djangoproj]$ git status 
On branch master
nothing to commit, working tree clean

[yeqiang@localhost djangoproj]$ git remote add origin  http://x.x.x.x/xxx/xxx.git
[yeqiang@localhost djangoproj]$ git push --set-upstream origin master
Username for 'http://x.x.x.x': yeq
Password for 'http://[email protected]': 
Counting objects: 79, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (72/72), done.
Writing objects: 100% (79/79), 91.86 KiB | 3.28 MiB/s, done.
Total 79 (delta 3), reused 0 (delta 0)
To http://x.x.x.x/xxx/xxx.git
 * [new branch]      master -> master
Branch master set up to track remote branch master from origin.
[yeqiang@localhost djangoproj]$ 

猜你喜欢

转载自blog.csdn.net/hknaruto/article/details/88057346
今日推荐