Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Development Tools

Git and best practices for web developer team

hello, i finished my git basic today, but i have several question to ask:

  1. I'm working on joomla/wordpress a lot, should i put the whole CMS script in a repo ? as i don't think i will make any changes on the core CMS script ?

  2. Can a branch directly push and merge to master in remote repository ? or do i need to use the step on push the branch, and merge in remote repository ?

  3. Is there any Access control level in GIT where i can restrict access to specific script for specific user ?

  4. If there's a bug in the couple of previous commit, can i revert back to that commit and delete the rest commit

Thanks for answering newbie :D

2 Answers

Hi Viktor,

As someone that has also just finished GIT basics - are you using any other resources to develop your learning in this. Like I say I have finished the course and not sure yet if I am ready to jump in and start using it for production or maybe I am just being a wuss.

G

Hi Graham, yes.. i have other material on hand that comes from oreilly... learning the theory is fun.. put into real world is another story... :)

by they way.. is there any method to add file into repository at once (recursively from folder and its file)

Patrick Cooney
Patrick Cooney
12,216 Points

You can pretty much set up whatever workflow you want. There are some recommended workflows but by no means are there requirements for how you use Git. I'll try to answer your questions as best as possible.

1) Even if you don't plan to make changes to the core, I would still check it in so that anyone who checks out a copy of your code has access to all the files they need. The only files I wouldn't check in are binary files (images, zip files, etc.).

2) As I mentioned in my opening you can really approach it however you'd like. I've used the git flow workflow within my company while working with an outside developer and it was okay though I didn't love it. I actually push directly to master all the time. All the things I do that are core parts of my applications I do directly on the master branch, then for the smaller stuff I make feature branches and merge them into master when it's ready to go. That sounds sort of like what you want to do.

3) This one I'm not 100% on, but I haven't come across anything in my time using git (about 1 year) that would lead me to believe this is possible

4) If there are bugs in the previous commits you can revert. You just need to know the commit number. GUIs are very helpful when it comes to reverting because you usually just have to right-click the commit you want to revert to and select a revert command.