Author Topic: HOW TO WORK ON GitGUI 1.7.11  (Read 29740 times)

Offline radius75

  • Colonel
  • ****
  • Posts: 108
  • I am the average PC user!
    • View Profile
HOW TO WORK ON GitGUI 1.7.11
« on: October 25, 2012, 02:28:25 pm »
HOW TO WORK ON GitGUI 1.7.11

I advise not to use local Branch 'master' to the work.  Always create new.
Use local Branch master and remote origin/master for Fetch,Merge&Push new Commits
from upstream (SupSuper/OpenXcom/master) into local master and remote origin/master. (they were identical for Comparing options on GitHUB)

Do not [Checkout] local repo to Remote Tracking Branch [HEAD] directly, create new local copy this Branch for [Checkout] &work.
Carefully use option [Reset] & [Force Overwrite]
I warn before the method "copy/paste" files in repo, for Commit and send this in Pull-Request.
Carefully! Have attention of consequences removal changes other Members (old Fixes, code improvements,etc.)[!]


And remember: Many hands make light work.

[All examples for my repo radius75/OpenXcom (origin)!!]

https://git-scm.com/downloads [latest v1.8.0]

FIRST STEPS
(1-3 only for new 'Fork' & create new local repo)

1. 'Fork' SupSuper/OpenXcom on GitHUB
2. Create new folder 'Git' for some repos on disk
3. Use 'Git Bash' to clone Remote 'origin' to local repo
4. Use 'Git GUI' to open local repo (config, SSH-Key)
5. Add tracking Remotes: 'upstream' (SupSuper/OpenXcom), and/or other project Members
6. 'Fetch' NEW CHANGES FROM REMOTES, LOCAL MERGE, PUSH TO REMOTE.
7. Create new local 'Branch' for work , Commits, Push to origin & Pull-Request to SupSuper/OpenXcom master
8. How to delete UNUSED remote Branch in my repo on GitHUB?
9. Switch local repo to some Branches or Tags [Checkout]
10. How to Fetch new Tags from upstream to my local repo?
11. Create Branch in the any point, in local repo.
12. How to withdraw changes in my remote Branch?
13. How to create Pull-Request to other Members / other Branches in OpenXcom project on GitHUB?
14. How to work on some Member Branch and Fetch & Merging some new Commits to this Branch?
15. How to update locally list Tracking Branches, deleted remotely, from other Members?
16. Why I can not make Local Merge?
17. How to Merge remote Branch without some last Commits into my local Branch?
18. Network graph on GitHUB
19. Compare Branches (or some Commits) on GitHUB (available only if repo on GitHUB have 2 or more Branches)
20. If I Merged some Commits into my remote Branch on GitHUB (from Pull-Request) , how to merge this Changes into my local Branch?
21. Automatc Merge Failed
22. How to change my last Commit (in my local & remote Branch)?
23. My local repo probably is damaged. Some Merging operations work otherwise than to expect.
24. Git Ignore - .gitignore file
25. How to update my Local Branch before Create Pull-Request (eliminate possible Auto-Merge Conflict systematically & update witch upstream/master)





1.
'Fork' SupSuper/OpenXcom on GitHUB




2.
Create new folder 'Git' for some repos on disk.

Example:
G:\Git


3.
Use 'Git Bash' to clone Remote 'origin' to local repo

Example for Member: radius75/OpenXcom (origin)


4.
Use 'Git GUI' to open local repo (config, SSH-Key)





OPTiONS




SSH Key - generate & GitHUB profile





5.
Add tracking Remotes: 'upstream' (SupSuper/OpenXcom), and/or other project Members

After some changes in Remotes (Add new/Remove), GitGUI require restart








6.
'Fetch' NEW CHANGES FROM REMOTES, LOCAL MERGE, PUSH TO REMOTE.


- 'Fetch' 'upstream' (SupSuper/OpenXcom)


- merge 'upstream/master' to local 'master'




- 'Push' local 'master' to 'origin/master' (radius75/OpenXcom)





7.
Create new local 'Branch' for work , Commits, Push to origin & Pull-Request to SupSuper/OpenXcom master


- create new branch, Starting at upstream/master (remote SupSuper/OpenXcom master)





- 'Commit' some changes [Rescan button for check, click selected file for Stage Changed]


- 'Push' Branch witch Commits to 'origin'



- Pull-Request for this 'Branch' on GitHUB to remote SupSuper/OpenXcom master.
Check first correctness of enclosed changes, before [SEND] Pull-Request.







8.
How to delete UNUSED remote Branch in my repo on GitHUB?

Example for my remote Branch "fix_for_#152"


9.
Switch local repo to some Branches or Tags [Checkout]










10.
How to Fetch new Tags from upstream to my local repo?




11.
Create Branch in the any point, in local repo.






12.
How to withdraw changes in my remote Branch?

Example for remote origin/master

-rename local Branch master to master1 [or something].

-create new local Branch 'master' in the any point you will want. (after this delete local  Branch 'master1' if U want)

-Push new local Branch 'master' to remote origin master and mark 'Force overwrite'.




13.
How to create Pull-Request to other Users / other Branches in OpenXcom project on GitHUB?

Example for User: pmprog - remote Branch "FromVS2k8SR"

- create new local Branch, Starting at Tracking Remote pmprog/FromVS2k8SR



- Commit local changes and Push to remote origin




- Pull-Request this Branch to pmprog/FromVS2k8SR on GitHUB
Check first correctness of enclosed changes, before [SEND] Pull-Request








14.
How to work/testing  some Member Branch and Fetch & Merging some new Commits to this Branch?

Example on remote d2uriel/master

- create new local Branch, Starting at Tracking Remote d2uriel/master



- Fetch & Merge locally some new Commits from Tracking Remote d2uriel/master to local Branch








15.
How to update locally list Tracking Branches, deleted remotely, from other Members?

[Prune]



16.
Why I can not make Local Merge?

Maybe:
- Some Unstaged/Staged Changes in local Repo waiting to Commit or Reset [!]



- Reset Unstaged/Staged Changes - all finally (carefully!)



17.
How to Merge remote Branch without some last Commits into my local Branch?

Locally.
Example on Tracking Remote d2uriel/master -> merging into local master:


- create new Local Branch in the chosen point (Commit)




- Local Merge new Branch into local Branch master



18.
Network graph on GitHUB

-for check possible Conflicts witch Branch 'master', before created Pull-Request into SupSuper/master




19.
Compare Branches (or some Commits) on GitHUB (available only if repo on GitHUB have 2 or more Branches)

-compare view: remote radius75/master <-> remote radius75/fix_for#152 (radius75/master is identical with SupSuper/master)






-compare with others commit (manual input)




20.
If I Merged some Commits into my remote Branch on GitHUB (from Pull-Request) , how to merge this Changes into my local Branch?

Example: remote origin/master
-Fetch some Changes from remote origin/master



-Merge remote origin/master into local master




21.
Automatc Merge Failed

Example: Merge Branch 'master' [6ad6500] into Branch 'abc' [afd5233] (Failed - Some Conflicts)

Merging all commits from Branch 'master' are breaks, all changed files waiting for manual Commit. (or Abort Merge)
(The cause of conflict: changes in files Branch 'master' happened during works over Branch 'abc')
 - 'Staged Changes'   - changed files - no direct Conflicts, waiting for possible fixes and/or [Commit]
 - 'Unstaged Changes'   - Conflicts Files, need manual fix and [Commit] or [Reset][!]
 - Yellow   - Conflict Changes from branch 'abc'
 - Blue   - Conflict Changes from branch 'master'
If conflicts changes are in the same the place (lines):
 - '<<<<<<< HEAD'   - Start
 - '======='   -  Separator
 - '>>>>>>> master'   - End (name of merged Branch - [local] master)






22.
How to change my last Commit (in my local & remote Branch)?

Example: Branch Dogfights
Local:
-[Checkout] to Local Dogfights
-mark [Amend Last Commit]
-possible execute changes: Stage/Ustage selected files, add new changes [Rescan] and move to Staged, change Commit message etc.
-save proper Staged changes in Commit [Commit]
Push to Remote origin:
-[Push] changed Branch Dogfights into Tracking Remote origin/Dogfights
-mark [Force overwrite] & Push





23.
My local repo probably is damaged. Some Merging operations work otherwise than to expect.

Probably some changes/damages in Tracking Branches [HEAD] local repo.
-Send all indispensable local Branches to GitHUB [origin] / backup repo folder on disk.
-New Clone operation (look at step 3.), add Tracking Remotes etc.
-Rebuild manually all local Branch (Fetch&Create new local Branch from origin, or manually move changes from backup)




24.
Git Ignore - file .gitignore

The list of ignored files, git does not check changes in these files and does not inform about them.
Example: .gitignore file from OpenXcom repo

Code: [Select]
# autotools
aclocal.m4
m4/
missing
install-sh
config.status
configure
Makefile
Makefile.in
depcomp
.deps/
*.tar.gz
*.tar.xz
openxcom
# Doxygen autogenerated conf
docs/Doxyfile
# basics
*.o
.DS_Store
Thumbs.db
#Ignore files built by Visual Studio
*.obj
*.exe
*.exp
*.pdb
*.dll
*.*.*.user
*.aps
*.pch
*.vspscc
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.bak
*.cache
*.ilk
*.log
*.tlog
*.zip
[Dd]ebug*/
*.lib
*.sbr
[Rr]elease*/
[Tt]est[Rr]esults/
_UpgradeReport_Files/
_ReSharper.*/
*.ipch
[Ii]pch*/
*.aps
*.svl*
*.mvf
*.*sdf
*.idc
*.tmp
#OpenXcom stuff
bin/data/GEODATA/
bin/data/GEOGRAPH/
bin/data/MAPS/
bin/data/ROUTES/
bin/data/SOUND/
bin/data/TERRAIN/
bin/data/UFOGRAPH/
bin/data/UFOINTRO/
bin/data/UNITS/
deps/
docs/html/
build/
Dependencies/
#Ignore Vim swap files
*.swp



25.
How to update my Local Branch before Create Pull-Request (eliminate possible Auto-Merge Conflict systematically & update witch upstream/master)

When the work with local Branch lasts long (or Pull-Request with this Branch waiting long time for Merge),
moore Conflicts witch Starting Branch/Revision can accumulate.

Example: local Branch 'Abc' Starting at upstream/master

-[Checkout] repo to local 'Abc' (if local is identical with origin/Abc) or Create new Branch, Starting at origin/Abc.
-[Fetch] Tracking Remote upstream/master
-[Merge] into local 'Abc' << Trackng upstream/master

If there are Conflicts: (look, guide step 21.)
- manually resolve conflict in files
- have attention of consequences removal changes other Members (Fixes, code improvements etc.)[!]
- to inform SupSuper/Members and to establish the the best solution together, without damage for the the whole of the code. Not to make difficult the work other Members.[!]

- after repair ALL conflicts: [Rescan], select ALL stopped files to Staged Changes, [Commit] & [Push] local Abc into orign.
- Remote Branch 'Abc' is ready to use in Pull-Request to upstream/master. (Also can do this for Branch in already Open Pull-Request.)




« Last Edit: November 13, 2012, 02:12:48 pm by radius75 »

Offline michal

  • Commander
  • *****
  • Posts: 629
    • View Profile
Re: HOW TO WORK ON GitGUI 1.7.11
« Reply #1 on: October 25, 2012, 02:30:06 pm »
Maybe it would be good to put such information also on Openxcom wiki?

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: HOW TO WORK ON GitGUI 1.7.11
« Reply #2 on: October 25, 2012, 02:49:00 pm »
Nice guide. :)

Maybe it would be good to put such information also on Openxcom wiki?
That's what I was thinking, although there isn't a specific place for it on there. All the contribution info is kinda spread around pinned threads on the forums. :P

Offline michal

  • Commander
  • *****
  • Posts: 629
    • View Profile
Re: HOW TO WORK ON GitGUI 1.7.11
« Reply #3 on: October 25, 2012, 03:11:05 pm »
Maybe something like that?
https://wiki.openmw.org/index.php?title=Developer_Reference

It's splitted into multiple pages.

Offline kkmic

  • Commander
  • *****
  • Posts: 582
  • Undefined
    • View Profile
Re: HOW TO WORK ON GitGUI 1.7.11
« Reply #4 on: October 25, 2012, 03:12:24 pm »
Is anyone using TortoiseGit?

Volutar

  • Guest
Re: HOW TO WORK ON GitGUI 1.7.11
« Reply #5 on: October 25, 2012, 07:09:59 pm »
This yellow font in instruction looks horrible with bright skin :)

Offline radius75

  • Colonel
  • ****
  • Posts: 108
  • I am the average PC user!
    • View Profile
Re: HOW TO WORK ON GitGUI 1.7.11
« Reply #6 on: October 25, 2012, 07:15:46 pm »
This yellow font in instruction looks horrible with bright skin :)
Better Yellow color than Warzone on GitHUB  8)

Offline radius75

  • Colonel
  • ****
  • Posts: 108
  • I am the average PC user!
    • View Profile
Re: HOW TO WORK ON GitGUI 1.7.11
« Reply #7 on: October 27, 2012, 11:39:42 am »
Basic manual is completed.

Offline d2uriel

  • Sergeant
  • **
  • Posts: 49
    • View Profile
Re: HOW TO WORK ON GitGUI 1.7.11
« Reply #8 on: October 27, 2012, 11:44:43 am »
Good job!

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: HOW TO WORK ON GitGUI 1.7.11
« Reply #9 on: November 16, 2012, 09:46:22 am »
having a "go-to" guide like this has proven incredibly helpful in figuring out Github.

GitGUI is so much better than the standard "github for windows" client, i think this is where most people run into trouble.

double thanks for both this guide and the software recommendation.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: HOW TO WORK ON GitGUI 1.7.11
« Reply #10 on: November 16, 2012, 01:28:26 pm »
Every Git client is better than GitHub for Windows. :P

Offline radius75

  • Colonel
  • ****
  • Posts: 108
  • I am the average PC user!
    • View Profile
Re: HOW TO WORK ON GitGUI 1.7.11
« Reply #11 on: November 16, 2012, 01:40:47 pm »
I'm glad I could help  :D

Offline hellrazor

  • Commander
  • *****
  • Posts: 2027
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: HOW TO WORK ON GitGUI 1.7.11
« Reply #12 on: March 28, 2015, 11:58:24 pm »
github is a nightmare... and it will ever be.