It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

I need to replace a whole directory in a branch

I have a new editor that I need to replace.

If in a branch I have some called EDITOR (folder with subfolders and files).

How do I replace the folder EDITOR with the new EDITOR - keeping same names.

I only want to commit and change this folder (and not other changes to other files).

I just want to force the new folder changes - hopefully al done at once.

3 answers

0 votes
Sauce Atlassian Team Apr 03, 2018

Hello Felipe, I am not sure I fully understand the situation. At first, I thought you might want to just rename the directory. This sounds like you want to replace the folder and its contents.  I suggest the following:

 

  1. Rename EDITOR to EDITOR.OLD
  2. Move/Drag and Drop new EDITOR Folder into the correct location of Repo
  3. git add --all
    git commit -am "<commit message>"
  4.  Check your local Repo to make sure this what you want and if so: 
    git push
  5. Once satisfied with Repo configuration and your build has been tested, you can delete the old folder

 

Hope this helps

 

Thanks 

Lonnie

0 votes
Ana Retamal Atlassian Team Apr 03, 2018

 

Hi Felipe! If my understanding is correct, you want to replace the existing folder with a new one, keeping the same old files inside the new one. Assuming that's what you want, it won't be possible to do that with Git, as that's not how Git works. I'm also assuming that you're using Git as it's the more widespread option and you didn't specify otherwise.

Git doesn't know about folders, in Git you can not have an empty folder for example. What Git "sees" is the file, if you change a file from one folder to another, Git will see that the name of the file was changed from oldfolder/file.txt to newfolder/file.txt. For Git, renaming a folder is to rename the path of every individual file inside it. 

Having said that, this doesn't look like a Bitbucket question so I've moved it to the Git category where you'll be able to receive further explanations if you need them :)

Hope that helps!

Ana

0 votes
Ana Retamal Atlassian Team Apr 03, 2018

I've just seen Lonnie's response and looks like we both understood something different. Please clarify your message if you needed something else so we can help you better! :)

Regards,

Ana 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Agile

Webinar: Dean Leffingwell and Steve Elliot present on SAFe 5.0, come ask Dean and Steve questions!

...steemed Steve Elliot (head of product for Jira Align). Agenda: What’s new or changed in SAFe 5.0: Introduction of OKRs Essential SAFe How to achieve true business a...

166 views 0 1
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you