----- Original Message ----- From: AD S To: Git for human beings Sent: Tuesday, February 28, 2017 4:28 AM Subject: [git-users] What's the best course of action when you need a file from another branch that is not yet merged with master?
I am new to git. I'm working on a large project that has many contributors. I've created a .scss file in a branch that has not yet been reviewed and merged in with master. I need that same file in a new branch to add some code to it. I've been told it is not a good idea to create the same file again as Git will see them as 2 different files with the same name and won't necessarily merge them together. What would be the correct way of dealing with this whilst waiting for it to be cleared in master? try `git help checkout` and look for the synopsis git checkout [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] [--] <paths>… This is the command to checkout a specific file from a specific branch (tree-ish). using the `--` helps make sure you discriminate between the branch and path parts. The statement that git will have problems is untrue, as long as it is the same file/filename in the same place/path. Your changes to it will (should) merge in just fine. However do have a fresh chat with your colleague about why they thought it was an issue. There may be a bigger picture you are not aware of, or the fact you will use the same path/to/file may bypass the issue. Philip -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
