Workflow with GIT

Workflow with GIT

Postby ikam » Tuesday, 10.July 2012, 14:00

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 :)
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: Workflow with GIT

Postby Skinnytorus » Tuesday, 10.July 2012, 14:25

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)?
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: Workflow with GIT

Postby ikam » Tuesday, 10.July 2012, 15:55

yes you can.
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: Workflow with GIT

Postby Skinnytorus » Thursday, 12.July 2012, 06:55

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.
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: Workflow with GIT

Postby ikam » Thursday, 12.July 2012, 14:47

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.
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: Workflow with GIT

Postby Skinnytorus » Thursday, 12.July 2012, 20:32

Many thanks man. It's there!
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46


Return to Development and contribution



Who is online

Users browsing this forum: No registered users and 12 guests

cron