Git Commands

problem:

rejected master -> master (non-fast-forward)

you have a readme file inside git remote repo. but you don’t have that in your local repo.

;;;;; I created a github repository after creating my local git repository so I needed to accept the changes into local before pushing to github. In this case the only change was the readme file created as optional step when creating github repository. ;;;;;

REF: https://stackoverflow.com/questions/11696295/rejected-master-master-non-fast-forward

 

solution:


1. git init

2. git pull https://github.com/*username*/*repository*.git master
in my case: git pull https://github.com/milon27/TextViewHelper.git master

3. git add .

4. git commit -m "new commit"

5. git remote add origin https://github.com/milon27/TextViewHelper.git

6. git push -u origin master


for readme.md file check this link https://guides.github.com/features/mastering-markdown/


Author: joker

Leave a Reply

Your email address will not be published. Required fields are marked *