• Website
  • Search
  • Member List
  • Help
  • Old Forum
  • Social Media
    •   @Wings3dOfficial
    •   @Wings3dOfficial
    •   Wings3dOfficial
    •   Wings3dOfficial
  • Register
  • Login
  • Website
  • Search
  • Member List
  • Help
  • Old Forum
  • Register
  • Login
Wings 3D Development Forum Wings 3D Programming v
1 2 3 4 Next »
Working with GitHub repository [updated: 04/02/2015]

 
  • 0 Vote(s) - 0 Average
Working with GitHub repository [updated: 04/02/2015]

micheus
Offline

Forum's Admin and Support | Bug fixer
Posts: 3,691
Threads: 186
Joined: Jun 2012
#8
06-15-2015, 09:02 PM (This post was last modified: 10-29-2015, 04:30 PM by micheus.)
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)
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.
you probably will need to use git pull as suggested:
$ git pull origin master
Quote:From http://github.com/Micheus/wings
* 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]
As 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:
# 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 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.
You can amend the commit now, with

git commit --amend

Once you are satisfied with your changes, run

git rebase --continue
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!
[Image: tw.png] @MicheusVieira [Image: yt.png] @MicheusVieira [Image: da.png] Micheuss [Image: ig.png] micheus4wings3d
* Wings3D Team stands for: Björn and Dan
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Messages In This Thread
Working with GitHub repository [updated: 04/02/2015] - by micheus - 06-07-2013, 08:33 PM
RE: Working with GitHub repository - by povmaniac - 06-07-2013, 08:50 PM
[Translating Wings3D] Working with GitHub [updated: 04/23/2016] - by micheus - 01-02-2014, 12:23 AM
RE: [Building Wings3D] Working with GitHub repository [updated 01/01/14] - by TulipVorlax - 01-02-2014, 02:14 AM
Re: Working with GitHub for Translations - by micheus - 01-02-2014, 04:41 PM
RE: [Building Wings3D] Working with GitHub repository [updated 01/01/14] - by TulipVorlax - 01-03-2014, 09:39 AM
RE: [Building Wings3D] Working with GitHub repository [updated 01/01/14] - by micheus - 01-03-2014, 04:02 PM
Updated: 06/15/2015 - by micheus - 06-15-2015, 09:02 PM
[updated: 10/29/2015] - by micheus - 10-29-2015, 05:00 PM
RE: Working with GitHub repository [updated: 04/02/2015] - by dgud - 10-29-2015, 07:07 PM
RE: Working with GitHub repository [updated: 04/02/2015] - by micheus - 10-29-2015, 07:14 PM
RE: Working with GitHub repository [updated: 04/02/2015] - by dgud - 10-30-2015, 01:41 PM
Using Dialyzer - by micheus - 04-17-2019, 01:37 PM

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D - Powered by MyBB

Linear Mode
Threaded Mode