Page 1 of 1

Workflow with GIT

PostPosted: Tuesday, 10.July 2012, 14:00
by ikam
preliminary :

In GIT bash :

Code: Select all
# config user (used to identify your post on github)
git config --global user.name "you_name"
git config --global user.email "youradress@mail.com"

# add FR as remote upstream (to easily update your repo)
git remote add upstream https://github.com/farbrausch/fr_public.git



preliminary with VC++ :

Code: Select all
# replace tabulations with 2 blank spaces
tools/options/text editor/C-C++/Tabulations : Smart, Tabulation size = 2 and Insert spaces



How I proceed :

Code: Select all
# first, I update my local repo :
git pull upstream master

# create a new branch (to leave master clean)
git branch new_branch_name <= create new branch
git checkout new_branch_name <= switch branch
or all in one :
git checkout -b new_branch_name <= create and switch

# add your change on source files
(ensure to respect tabulations and formatting)

# check your work
git status <= displays files that have changed
right-click on your FR_public root directory and select git gui (you will show diff)
ensure there is no RED block (they are white spaces) if they are, delete them on your source, and right click refresh
when your source file is clean go next step

# commit your work
git add files1 files2 files3 etc... (to add your files, you can show changed files with git status)
git commit -m "WZ4: description of your commit"

# push your work on your github account
push origin your_branch_name
(enter your password)

#end


When you are ready to a pull request go on github website on your account and go to your uploaded branch and select pull request :)


Here are the basics, don't hesitate if you have difficult or need others commands

good luck :)

Re: Workflow with GIT

PostPosted: Tuesday, 10.July 2012, 14:25
by Skinnytorus
Wow. Thanks!
"# add your change on source files
(ensure to respect tabulations and formatting)"
- This step is somewhere in the middle... But can I add my changes before all the procedure (I need to test my builds beforehand)?

Re: Workflow with GIT

PostPosted: Tuesday, 10.July 2012, 15:55
by ikam
yes you can.

Re: Workflow with GIT

PostPosted: Thursday, 12.July 2012, 06:55
by Skinnytorus
hi, ikam
So, my branch is almost ready. I'll have to fix one shortcut this evening and will be ready to submit a pull request.
See for yourself: https://github.com/Skinnytorus/fr_publi ... _shortcuts
Along with that, I have a couple questions:
1. I accidentally merged my commits into my master branch. Is that OK?
2. If ryg updates his master today, how do I update my new_shortcuts branch together with my master fr_public? I mean, how do I keep the branch up to date?
Thank you.

Re: Workflow with GIT

PostPosted: Thursday, 12.July 2012, 14:47
by ikam
It's seems to be ok :)

1. no problem, leave your master like this. You can also do a : "pull origin master" to restore it, if you want.
2. You don't need to update your branch. Ryg will merge your branch with his master.

Re: Workflow with GIT

PostPosted: Thursday, 12.July 2012, 20:32
by Skinnytorus
Many thanks man. It's there!