I've been having a hard time with Git since I started using it. It's a learning curve that I want to beat. I've read thru the manuals and FAQs and several other sites but I'm still not seeing the behavior that I expect and hoping someone that's using VS2010 with GiHub can't give me the magic pointer I need.
These are the steps that I do to create a new project/repository.
1. Create new repository on GitHub - give it a name and create it
2. Create my solution in VS2010
3. Commit for first time
These are the steps that I take to commit the solution for the first time: (I have git and git extensions installed and I have a VS Toolbar created that allows me to pop up the git bash from within VS2010)
I click on the Git Console button I have created on the toolbar and I get the bash window and the current directory is the root directory of my solution
I then execute these commands to commit my solution to the GitHub repository on the GitHub site
1. git init - works fine
2. git add . - works fine
3. git commit -m 'First commit' - works fine
3. git remote add origin git@github.com:alfalfastrange/RepositoryName.git - works fine
4. git push -u origin master - I am then treated with a reject message and an error about fastforward etc, etc...
5. git pull origin master - works fine
6. git push -u origin master - the commit works and I can then see the whole solution online on GitHub
Now the problem I have is from here on out... if I make and changes to my solution I cannot get them into GitHub. For example, I delete files, add files and add code, etc and then I'm ready to commit all these changes
I've tried these sequences of events and had no luck
1. git add .
2. git commit -m 'Second commit' - adds changes to the local repository
3. git push -u origin master - Am given message that everything is up to date, I check the online repository and there have been no changes made
4. git pull origin master - Am told everything already up to date
5. git push -u origin master - Am given message that everything is up to date, I check the online repository and there have been no changes made
6. git push origin master - Am given message that everything is up to date, I check the online repository and there have been no changes made
It seems all the commit does from that point on is commit changes to the local repository and none of the commands I've tried will push the changes to the GitHub repository.
So at this point I'm slightly annoyed that it's not easier. With my Ankh SVN and Codesion setup all I have to do is click Commit or Update to push changes or pull latest from the online repository.
What am I missing? Because I want to be able to use Git successfully and without fear for all of my personal projects. Thanks in advance!
UPDATE
After running the git branch -avv command this is the result
Update 2
After running steps 1 - 6 with the -f added to step 3
Update 3
After running sequence of commands from answer
Which doesn't make any sense to me because we did all that already... I'm using only the Git Bash