|
Working with GitHub repository [updated: 04/02/2015]
|
|
06-15-2015, 09:02 PM
(This post was last modified: 10-29-2015 04:30 PM by micheus.)
Post: #8
|
||||
|
||||
|
Updated: 06/15/2015
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: Quote: ! [rejected] master -> master (non-fast-forward)you probably will need to use git pull as suggested: $ 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. 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. 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. 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!
|
||||
|
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)




@MicheusVieira
MicheusVieira
Micheuss
micheus4wings3d