Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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
Lonnie 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
TAGS
Community showcase
Published in DevOps

Step up your DevOps game webinar Q&A series - Questions answered!

  On October 21st, 2020 we hosted a webinar titled,   Step Up You DevOps Game with 4 Key Integrations for Jira and Bitbucket. We had a great showing and high engagement, but that meant th...

101 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