Git-GitLab Note:

Solve the question :


hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

1.use enforce way "push"

$ git push -u origin master -f
! but it is will amend the file or lose the file, especially in the development of co-operation.

2.pull the repository before you push the file:

$ git pull origin master

$ git push -u origin master

3.build a new branch then mergy

$ git branch [name]

then ** "push" **
$ git push -u origin [name]
! after git 2.9.2 nedd add "--allow-unrelated-histories" after it

Git command


git init // put the catalog change to a repository of git
git add README.md // add some file
git add . //add all files
git commit -m "first commit" //commit files to repository
git remote add origin git@github.com:wangjiax9/practice.git //relate the repository with local's
git push -u origin master // push to repository finally

Joe.

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容