Updating your master branch with the official one
By considering you create different branches for the changes you do, it's a good idea update the master branch when the official one is updated. This way, every new branch you create will be "synchronized" with it:
$ git checkout master
$ git fetch origin
$ git reset --hard origin/master (ensuring your local master is the same your remote/origin)
$ git fetch dgud (updating your local references to the master dev)
$ git rebase dgud/master ("synchronizing" your local with the official one)
$ git push origin master (updating your remote branch master)
If you get this kind of error message:
$ git pull origin master
Fixing the last commit you just pushed to origin
$ git rebase -i HEAD~1
The editors will start with the last commit reference prefixed by pick and followed by a comment showing the commands you can use:
If you chose reword, after you save and exit the editor it will be started again with the last commit message to be edited.
If you chose edit, then you will see something like this:
Then, as suggested in the message above, we can use git commit --amend to update the commit message and after this we use git rebase --continue in order to commit the changes.
Now we just make a new forced push to origin and it's done!
By considering you create different branches for the changes you do, it's a good idea update the master branch when the official one is updated. This way, every new branch you create will be "synchronized" with it:
$ git checkout master
$ git fetch origin
$ git reset --hard origin/master (ensuring your local master is the same your remote/origin)
$ git fetch dgud (updating your local references to the master dev)
$ git rebase dgud/master ("synchronizing" your local with the official one)
$ git push origin master (updating your remote branch master)
If you get this kind of error message:
Quote: ! [rejected] master -> master (non-fast-forward)you probably will need to use git pull as suggested:
error: failed to push some refs to 'http://github.com/Micheus/wings.git'
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.
$ git pull origin master
Quote:From http://github.com/Micheus/wingsAs is all OK now, we can try the last git push command again. That is valid for any local branch.
* branch master -> FETCH_HEAD
Merge made by the 'recursive' strategy.
src/wings.erl | 339 ++++++++++++++++++++++++++++-------------------------
src/wings_file.erl | 22 +++-
2 files changed, 196 insertions(+), 165 deletions(-)[/color]
Fixing the last commit you just pushed to origin
$ git rebase -i HEAD~1
The editors will start with the last commit reference prefixed by pick and followed by a comment showing the commands you can use:
Quote:# Commands:if you want only to change the commit message, replace the pick by reword; if you want make other changes to the code using the same commit then replace it by edit.
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message
# x, exec = run command (the rest of the line) using shell
If you chose reword, after you save and exit the editor it will be started again with the last commit message to be edited.
If you chose edit, then you will see something like this:
Quote:Stopped at 8e59ce9... Fixed menus issue related to use of [option] flag.Just proceed with our changes to the source code. After we've finished it we need to tell to git which files to update by using git add command. We can check this by using git status command.
You can amend the commit now, with
git commit --amend
Once you are satisfied with your changes, run
git rebase --continue
Then, as suggested in the message above, we can use git commit --amend to update the commit message and after this we use git rebase --continue in order to commit the changes.
Now we just make a new forced push to origin and it's done!