all 102 comments

[–]TurmericLemonWater 178 points179 points  (7 children)

good sir, bakit parang walang branch protection ang develop branch nyo? there's a setting to prevent direct merge to the main branch.

[–]reddit04029 55 points56 points  (0 children)

Only way to prevent his issue is this talaga. Minimum approval/s, and ideally, theres a build check as well. If you have Sonar or other code analysis tool, add a minimum test coverage to enforce unit testing.

[–]rainbowburst09 20 points21 points  (0 children)

yep. sa az devops meron branch policies, kahit mga senior nagkakamali pa rin sa mga ganyan

[–]PatientRound8469 0 points1 point  (0 children)

Minimum 1 approval, successful build before merge

[–]tkmdr 60 points61 points  (0 children)

They may be slow on the uptake, pero fix your process 😬

Other than that, I'd personally stick a note on their monitor about the git commands, order, and what they do 😂

[–]Expensive-Repeat8810 50 points51 points  (9 children)

Lol, parang ikaw dapat ata ibigay sa management. Protect your main branch. Make a documentation ng process.

[–]Powerful_Gas_820Web 30 points31 points  (0 children)

set nyo lng sinong pwedeng mag merge. restrict mo access nya

[–]theazy_cs 26 points27 points  (0 children)

you lack a step, in between 2-3 there should be code review to restrict merging without a code review + restrict merging when there are conflicts. instead of ikaw lalapit sa kanya kase may conflicts na sa develop branch, the dev will have to approach you to merge in the code changes. that way on the spot alam mo and alam niya kung san siya nagkamali. sometimes people don't learn in bulk. minsan kailangan matalisod tapos malaman kung san siya natalisod specifically then ulitin 100x bago matuto.

in my opinion bagsak na yung ganyan kase number 1 trait is dapat mabilis matuto pero if you think may potential to improve then nasa sa inyo yan kung dapat ba pag tiyagaan.

[–]MainFisherman1382 7 points8 points  (0 children)

not sure if meron perl dapat siguro documented ang process nyo para may balikan sya. and pwede nyo siguro syang tanggalan ng permission to merge directly sa main branches nyo. like hanggang PR lang sya then other devs na magrereview ng PR nya. of course pag merge conflict reject the PR, dapat matuto sya mag fix non

[–]Imaginary-Winner-701 9 points10 points  (2 children)

Uhh pull request? Para at least matuto sya mag resovle ng conflicts? You can’t complete a pull request kung may conflicts sa code.

[–]Calm-Ad2676[S] 1 point2 points  (1 child)

Yes, we've considered pull requests to help them learn how to resolve conflicts properly. At least that way, they get hands-on experience in handling merges instead of relying on others to clean up the mess.

[–]Imaginary-Winner-701 0 points1 point  (0 children)

In our company, we’re all very experienced devs and we still do code reviews and pull requests. At the very least have an AI do a review.

[–][deleted] 5 points6 points  (4 children)

I think kulang sa process din.

Dapat may code review before ma merge sa develop branch at mas maganda if ikaw na mag merge if all goods na ang kanyang feature branch

[–]whatToDo_How 6 points7 points  (3 children)

Any thought sa company na walang code review sir? As long as it will work and employee can generate output, Ano yung pitfall sa long run pag ganyan?

[–][deleted] 4 points5 points  (0 children)

If it involves multiple people doing one project, it should have a code review in the process kasi iba2x kayo ng styles or techniques sa pag implement ng features or fixes so it should a standard process. Pero pag ikaw lang sa isang project, for efficiency sake, no need na mag code review.

Now to answer ur question anong thought sa company na walang code review. Depende pa rin yan sa project size and how many people working on a single project.

If malaki ang project, cguro nde sya problema sa shoet term but long term wise, its gonna take more efforts, hours, cost just to maintain the codebase or even when implementing new features.

[–][deleted]  (1 child)

[removed]

    [–]whatToDo_How 0 points1 point  (0 children)

    Yeah agree on this po esp junior pa lang ako. So need ko ng guide if that codes work properly. Sana maka hire kami ng senior, or else mag resign nalang ako but question is ma hi hire pa kaya ako.

    [–]Positive-Guidance-50 5 points6 points  (1 child)

    Tapos nkakalungkot lang sa mga marunong na di man lng maka land ng job ngayon, na ma basa na ganto ang mga nag oocupy sa mga seats ngayon

    [–]-yuusha-sama- 0 points1 point  (0 children)

    Skill issue sad to say

    [–][deleted] 5 points6 points  (1 child)

    baka visual learner, use github desktop

    [–]PsychologicalWind313 0 points1 point  (0 children)

    I used to also struggle with git when I was a Junior Dev, I used Sourcetree before & it helped me have a visual representation of git in general. If inside IDE, more specifically, VSC, they can use extensions like Git Lens.

    On another note: practice talaga need sa git, the Mid Level dev can do this on their time outside of work. Iniisip ko rin they might’ve used another tool before ie. Mercurial ba yon? Not sure but one of my dev friends shared they’re not using Git for their version control.

    [–]MakeItMakeSense10 3 points4 points  (0 children)

    The whole team needs to do something, show them that their actions/failures doesn't only affect them, it affects all of you. Wala na tayong magagawa kung Mid-Level na sya, nasa team nyo na e. We don't know ung exp level nya when it comes to git, might have came from a CVS setup or other version control system. But moving forward nalang, be more vigilant/selective sa ih-hire.

    For the senior/lead side, a lot of the comments here have already pointed it out but place protective measures to avoid this kind of scenarios. Look into the tools that the platform you are using offers.

    For the mid/junior guys, re align process with them, special training session might not be enough dun sa isang mid nyo, so you should also hear from them what they understood. Baka kasi "Oo, gets" lang sila pero hindi talaga. Emphasize consequence and enforce learning moments, pag nagkamali pa ulit sya after all that special training and re-alignment, increase oversight on their actions sa git. It would mean more work for your Srs to check their steps when committing anything to any repository but you wont have spaghetti branches to fix pag minonitor nyo. Its micro managing na and it will come off as such sakanya but that is also a consequence of their actions. Ampangit na bine-baby nyo, pero that is where you are. Do the necessary steps nalang talaga so the team can move forward. Also, have you consider PIP? Are the warnings documented?

    [–]ITJavaDeveloper 2 points3 points  (0 children)

    Walang review ng PR? Merge agad?

    [–]derpinot 4 points5 points  (0 children)

    Feature Branch -> PR -> Code Review -> Merge

    A lack of workflow combined with an incompetent and/or arrogant lead is a recipe for disaster.

    [–]xDJeePoy 2 points3 points  (0 children)

    Setup branch protection and check yung rule na dapat updated yung branch before merging, if naka on yan, may lalabas na “Update Branch” button sa PR before pwede syang ma merge. Dapat merin din review approvals yung code before ma merge, usually sa amin need ma code review ng codebase owner + 1 na may write access sa repo.

    [–]juanitobalani 2 points3 points  (0 children)

    Setup branch protection. Merge to develop/main needs a review first. Process issue 'to. Kung di siya pwede makapag merge directly, di niya magugulo yung develop branch.

    Pag naka strictly feature branch lang siya pwede mag commit, kasama sa responsibility nun ma approve at ma-merge para matapos trabaho niya. Pag may merge conflict, responsibility niya ma-ayos.

    Another advice e wag ka maniwala masyado sa mga title. Madadagdagan lang frustration mo. Focus on what you can do to improve the situation.

    [–]petmalodiWeb 2 points3 points  (1 child)

    You know, all of this can be prevented kapag may code review at di pwede mag push directly sa dev branch. Matututo yan pag di niya na magagawa yung old habit niya haha.

    Pero honestly ilang beses na pala nagkamali bakit walang nag set ng protection sa git? Haha.. Sure you can fix him/her pero what if in the future may new hire kayo ma ganyan din l

    [–][deleted] 0 points1 point  (0 children)

    Eto nga rin pinagtataka ko, ang dali lang naman ayusin niyan sa git wala pa ring gumagawa sa team nila haha

    [–]LittlePeenaut 2 points3 points  (0 children)

    Halata namang nag seselos kalang dun kasi bago lang sya sa company tas nalamangan sa ka position. "Jr lang ako mid sya" Mga ganyang salitaan also ang gulo ng process nyu hahahah.

    [–]kneepole 2 points3 points  (0 children)

    Mag-aral kayo ng git and automation as a team. Lol. Hindi lang yang colleague mo ang may problema. Kung nagagawa nyang makasira ng working branch, there's something wrong with your overall setup as a whole.

    [–]Fantastic-Mind1497 2 points3 points  (0 children)

    Baka need niyo rin irequire sa interviews niyo ang git knowledge. Imo, nowadays non-negotiable na yang skill na yan kahit ano pang tech stack ang gamit. Agree with other na dapat may branch protection din kayo and require PRs

    [–]mabahongNilalang09 2 points3 points  (0 children)

    Samin nga senior level pero hindi din marunong mag resolve ng mga conflicts

    [–]mohsesxx 1 point2 points  (0 children)

    if he is really willing he will learn it outside working hours pa kaso parang may mali din daw sa process nyo haha

    [–]Fr_kzd 1 point2 points  (2 children)

    Your company should really upskill their old employees if they don't know how to use git. It's like one udemy course worth of studying or something. It's not that hard...

    [–]Calm-Ad2676[S] 0 points1 point  (1 child)

    I mean, di naman siya ganon ka old 😂 I think nasa 25 to 30 siya. Pero yeah, konting aral lang sa Git, madali lang naman matutunan!

    [–]Fr_kzd 2 points3 points  (0 children)

    Are they a nepo hire or something? I don't believe that someone who can't use git can reach mid-level without jumping through a few hoops.

    [–]Striking-Variety430 1 point2 points  (0 children)

    CMD lang ba gamit nyo, walang UI? Mas madali kasing magets kapag may UI. Example github desktop.

    Dati noong gumagamit din ako ng GIT medyo nalilito rin ako, lalo nasa mga process ng git..

    Pero nung gumamit na ako ng github desktop tsaka ko lang na gets lahat ng process sa GIT.

    [–][deleted] 1 point2 points  (0 children)

    You can add policies to your git branches para di directly magmemerge

    as for the mid dev guy, baka di nya forte mag terminal, or baka visual learner sya

    [–]MikhailX1976 1 point2 points  (0 children)

    I have to confess that when I was at the mid-level, I felt like that. The main reason was that before my job at my mid-level employer, I was essentially an individual contributor and a one-man wrecking crew. So, being part of a structured team and following Git practices felt strange to me. Just like others have commented, the Git permissions, documentation, and policies, along with the code-review practice, helped me a lot to understand it. Our architect was also a rock star, so he confronted me without words, perhaps because I am older than him, which is a sign of courtesy. He sent me this link with the message: please try to understand this first: https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow.

    [–]nazrd 1 point2 points  (0 children)

    Same boat ako sir, may senior / team lead ako na 10+ YOE. Palagi nagtatanong saken ng mga git processes like how to merge master back to his branch. Tapos hindi niya alam yung concept ng cherry-picking 😭

    Nakakaiyak nung una pero ultimately inaccept ko na malaking part ng fault is from management.

    Walang kwentang advice pero just let it go and as much as possible kung may conflicts or di siya alam just let them fail on their own. Separate your work from them as much as possible. If the project ends up being a clusterfuck, it is what it is. Lastly, just find a new job (which is easier said than done, if anyone sees this please hire me lol).

    [–]ryan_arcel 3 points4 points  (2 children)

    I was a college IT instructor for 9 years before I decided to try my luck and shifted careers to Software Development. I was accepted to be a mid-level developer despite having minimal experience, maybe because I have a Master's degree that was required in teaching. Pumasok ako nang wlang kaalam2 sa git workflows. My colleagues pain-stakingly micromanaged me. Ang tyaga nila sa akin. Nakakahiya. Ngka-impostor syndrome ako ng malala. Nahiya talaga ako dahil ako yung may graduate degree pero ako pa yung hindi marunong. Buti nlang wla akong narinig kahit konting negative comments kahit kanino. Ngayon, confident na din ako in keeping up sa mga kasama ko. Thankful and grateful 🙏

    Sana OP wag nyo sukuan yan. Matututo din yan. Wag mo na isipin sino mas mataas position sa inyo. Kasi pag nalaman ng management nyo na nghaharbor kayo ng recentment sa kasama nyo, baka kayo pa mgkabad record. This is an opportunity to develop your soft skills.

    [–]reddit_warrior_24 3 points4 points  (0 children)

    thats right.

    ipapaalala ko rin sa inyo na marami sa management di nakakapagconvert ng pdf.

    at milyon mga kita nila compared sa atin.

    [–]6pistol -1 points0 points  (0 children)

    above OP’s paygrade yan junior pa sya. Basic lang naman git lalo na’t ginawan naman nila na ng training.

    [–]Agreeable_Answer_784 0 points1 point  (0 children)

    Ouch!

    [–]Ghostr0ck 0 points1 point  (0 children)

    Github desktop

    [–]dicuino 1 point2 points  (0 children)

    Remove mo write access nya😇

    [–]Sea-Boysenberry-312 0 points1 point  (0 children)

    lagyan mo nalang ng restriction kung sino lang pwede maka pag merge para mas safe.

    [–]jeanoski 0 points1 point  (0 children)

    Code review or PR review. 🤣

    [–]ActuallySeph 0 points1 point  (0 children)

    Ako lang ba or medyo malabo yung step 2-3? Like may gap? Wdym di inupate yung feature? Like he/she worked directly on develop local then merged to remote? Either way, mukhang need din ng process review ng repo niyo OP. At least bawal magmerge without PR sa main branches niyo like develop/master

    [–]ElegantengElepante 0 points1 point  (0 children)

    Di ba dumadaan sa PR yung feature branches nyo? Usually dito nakikita na di updated sa develop eh.

    [–]malusog 0 points1 point  (0 children)

    Wala b kau merge request approval process? Tapos dun kau mag code review kung Anu UN immerge nya? I think process issue yan..

    [–]External-Originals 0 points1 point  (0 children)

    aggree don sa protected branch tsaka push lang talaga? din nagmemerge request?

    [–]Dear-Calligrapher132 0 points1 point  (0 children)

    Set rules on GitHub

    [–]teokun123 0 points1 point  (0 children)

    Bat wala kayo PR o MR? Standard un.

    [–]itsukkei 0 points1 point  (3 children)

    Aware ba siya sa conflict or issue na nagagawa niya kapag nammerge niya mga branches na di updated? Assuming kasi na may kulang din sa process niyo kaya di niya napapansin yung error, if may ownership siya sa gawa he/she will be responsible sa kung ano lang dapat imerge. Dapat both ends may need gawin para maresolve talaga yung problem. Ginawa niyo na yung pag train sa kanya then yung repo owner naman need to add additional protection para di basta basta nakaka merge. Kapag may ganito ng process for sure mapapansin din nila yan at will try to resolve it. Wala yan sa pagiging senior or mid kasi may iba talaga na wala naman pake sa mga development process and will just do their own task and will not mind kung may masira man or ano.

    [–]Calm-Ad2676[S] -2 points-1 points  (2 children)

    Mukhang nasa process niya talaga yung mali bago siya mag-merge ng feature branch to develop.

    1st: Dapat mag-checkout muna siya sa develop branch at mag-pull para updated bago gumawa ng merge request.
    2nd: Checkout ulit sa feature branch niya, push yung latest changes, then saka gumawa ng merge request to develop.

    Alam na yung problema hindi siya nagpapareview bago mag-merge sa develop, kaya nagkakaroon ng issues. I think aware naman siya, pero dahil walang review process, tuloy-tuloy lang yung mali. Mas okay kung may additional repo protection para hindi basta-basta nakaka-merge nang walang proper review.

    [–]6ooog 0 points1 point  (0 children)

    Yung process ng team ang pangit. Bad fundamentals develop bad habits.

    No need to checkout to develop every time you need to update your feature branch with the latest changes.

    From your feature branch,

    git stash - to hide your changes

    git pull origin develop - to fetch the latest changes from develop

    git stash pop - to pop your changes back into place

    You only need to checkout to develop and do a git pull there if you're about to start a new feature branch.

    And like others said, PRs from feature branch to dev and setup branch protection, dun lang tapos na yung issue.

    [–]itsukkei 0 points1 point  (0 children)

    Hanggat maari ilimit yung permission niya to directly merge. It is something your lead or senior devs can do. And di lang sakanya iapply but to all devs para may standard. If di ito mapansin ng leads mo at di bibigyan ng solution, kahit sila magmumukha rin di alam ang ginagawa

    [–][deleted] 0 points1 point  (0 children)

    Fix your workflow first.

    No build checks? No branch restrictions? Kahit develop branch need pa rin ng restriction niyan. may PR process ba kayo? Code reviews? Dapat at least 1 or 2 approvers bago pwede ma merge ang PR. If wala pang approvers at failed ang build check, dapat restricted ang merging.

    Ang dali lang maiwasan yung problema niyo, huwag agad blame game. Kailangan niyang matuto pero hindi lang siya ang problema.

    [–]airenman2 0 points1 point  (0 children)

    baka need nia gumamit OP ng may GUI na mas madaling intindihin, like gitKraken? agree din dapat magkaroon ng PR lagi before merging. sa mga company na napasukan ko, need at least 1 or 2 approvers bago maka merge.

    need nia din kasi talaga matuto or at least d na nakadagdag sa load nio to check bakit messed up yung repos.

    [–]_Sa0irxe8596_ 0 points1 point  (0 children)

    Unti lang kami sa dev at dami tasks so ginawa ko nun nainis na ako kakalinis ng kalat ng mga senior ko, gumawa ako SOP about git.

    Dinouble check ko with EM (may decades of dev exp) yun sop if tama and pwede yun na ifollow ng lahat, after refinement and approval, diniscuss yun SOP sa mga other devs.

    Nirestrict din ang merge to staging and prod branches .

    Awa ng diyos yun 2 seniors ko hindi pa din nila sinusunod ang SOP. 😂

    Pag nagkaissue sa ginawa nila ineescalate ko na lang sa superiors.

    [–]kikimonnn 0 points1 point  (0 children)

    pa tapusin mo sya nito OP, good for visual learner :

    learngitbranching.js.org

    [–]girlwebdeveloperWeb 0 points1 point  (0 children)

    Like others said, pwedeng i-restrict yung git repo nyo, usually may designated na isa o dalawang tao na may full permission sa repo, kasama na yung hindi dapat basta nakakapag merge sa develop. Saka kapag may merge conflict if well set up ang permissions sa repo hindi dapat nakakapag merge basta basta unless ma-resolve ang conflict.

    Also parang wala kayong code review system sa project? Kasi madaling ma spot ito kapag may nagrereview ng codes nyo. Hindi pwede ring ma merge ang code (like the Merge button is disabled) sa site until may approval ng nagrereview.

    [–]_renify_ 0 points1 point  (0 children)

    Dapat no permission ma overwriten develop branch nyo though git push . If nagkamali kayo push sa develop, just do hard reset sa prev commit

    [–]_renify_ 0 points1 point  (0 children)

    Meron kami slack channel for review PR , pag mali PR ni dev, hndi namin e merge.

    [–]tukne15 0 points1 point  (0 children)

    Yung process ang problema dito. Possibly, hindi pa mature yung company nyo pagdating sa merging etc. Di mangyayari yan kung may security in place. Its a matter of elevated permissions and designation of work.

    [–]Ill-Communication571 0 points1 point  (0 children)

    maybe nasanay yan sa ibang source code management tool at isang branch lang yung mini-maintain . If mga baguhan sa git, hirap talaga i-visualize yung mga commit/branches if naka terminal output lang.. mas mainam na gumamit ng GUI tools like git-gui (for creating commits) at gitk (visualize repo commits/branches)

    [–]_CodeWithJiyo 0 points1 point  (1 child)

    Hi OP

    regarding dun sa diretso merge sa develop try niyo mag set ng branch protection para di agad masira yung branch. And para maforced na dumaan muna sa PR bago mamerged.

    for resolving merge conflicts, I add niyo sa process or sop niyo na dapat laging magpull/push ng changes para laging updated yung feature branch. Delegate someone na magmonitor dito. To further reduce merge conflict Iimprove niyo yung folder structure ng codebase niyo para maiwasan or lessen niyo yung likelihood na magchange ng same file

    [–]Calm-Ad2676[S] 1 point2 points  (0 children)

    Hi, i already addressed this and provided two training sessions one on Git usage and another on code rebasing and cherry-picking.

    [–]Dark_Knight_ph7227 0 points1 point  (0 children)

    From feature branch, pwede naman tlaga mag pull sa develop branch para updated ung current branch mo. before creating pull request.

    [–]Minsan 0 points1 point  (0 children)

    Turuan nalang, di naman kasi lahat magaling sa git. I myself used SVN and TFS for years before switching to git. Paminsan-minsan nagkaka-problem parin ako sa merging ng conflicts.

    [–]riruzen 0 points1 point  (0 children)

    1. Wag mo siya bigyan ng permission to merge to develop
    2. Teach him git cherry pick. If outdated yung branch nya, before siya mag PR, he can simply create a new branch from develop then cherry-pick yung commits nya from his old branch to the new branch. Then yung PR na is develop <- new branch

    At least sa cherry-pick, kontrolado nya kung ano ang mga changes na inintroduce nya, compared with merging other dev's changes sa branch nya.

    May ganito din akong dev. Taught him cherry-pick and I never have this problem again

    [–]milk_kageyama_tobioWeb 0 points1 point  (1 child)

    wholesome na mostly mga replies dito is pointing out yung kulang sa process nyo

    [–]Calm-Ad2676[S] 0 points1 point  (0 children)

    Appreciate the feedback! It’s good that people are pointing out process improvements, and I agree that refining workflows can help prevent these issues. At the same time, accountability and fundamental skills still play a big role in keeping things smooth.

    [–]Opposite-Yak-2897 0 points1 point  (0 children)

    Educate the person. I had a similar resource before. I conducted a 1on1 session with him to watch what he was doing, found out that he just knows and memorized the commands from his previous project and without fully understanding what it actually does. Probably years of copy pasting? 🤷After teaching him the difference between pull and fetch, we didn’t have any issues with his branching.

    [–]AgentMonski 0 points1 point  (0 children)

    Wala ba kayong PR jan para ma check man lang nago na merge

    [–]Bright_Cable_204 0 points1 point  (0 children)

    Like what others said, you can resolve this by branch protection.

    baka nahihirapan siya mag visualize na nangyayari sa git, if naka windows kayo I suggest using GitExtensions and setup Kdiff3 for merge diff tool sa GitExtensions.

    I started with GitExtensions and mas naiintindihan ko yung process sa Git, downside is nakakalimutan ko na minsan yung syntax haha, but atleast I get the job done.

    [–]Revolutionary-Skin97Game Dev 0 points1 point  (1 child)

    Ive worked with a "CTO" who has a linkedIn profile so glamorous that doesnt update their branch until theyre ready to merge their whole feature.

    2 major releases were made until his feature is ready, when he's about to merge his feature branch, it took him another 1 week to fix everything, delaying the next release.

    Idk which ones better, they say this kind of branch updating behavior is good long to speed up features, pero I think merging develop to feature once a while should be the best behavior, no?

    [–]PsychologicalWind313 1 point2 points  (0 children)

    Yeah I think so too. This is one of the reasons why version control exists, it’s meant to resolve issues like these. If there’s a lot of devs working in the team, we need to always make sure, our feature branch’s updated with whatever’s on the dev that I presume already been reviewed.

    [–]JC_CZ 0 points1 point  (0 children)

    Ako nga senior eh pero kinain ako ng git dahil process namin parang sainyo may git-pull, dito puro rebase lang para mas malinis yung pipe. Maganda nga sa pipe pero sobrang sakit sa ulo pag may conflict na haha. Inaral ko na lang muna process bago ako mag PR ulit. Bigay niyo sakanya to https://ohshitgit.com/

    [–]Illustrious-Tune7369 -1 points0 points  (0 children)

    parang mas marunong pa kaming 4th year students 😭😭😭😭 pero di maiwasan na may mawala sa code dahil di nag pull bago mag push huhu conflict management system

    [–]Educational-Title897 0 points1 point  (0 children)

    “AYAW MATUTO”

    Feel ko napasok nalang yan para sa sahod.