How do you restructure working directory files in a git repository?

0 votes
How do you restructure working directory files in a git repository?
Nov 26 in DevOps Tools by anonymous
• 6,650 points
51 views

1 answer to this question.

0 votes

If we have a file called 'myfile.txt' to restructure/move in the sub directory 'mydir' under git's working directory; rather than cut and paste(manual mv command), we can use 'git mv ' 

e.g. 'git mv myfile.txt mydir'. 

This will move the file to provided directory and marks it to 'staging'.

If we use 'git status' command now, it will display changes available to commit e.g. 'renamed: myfile.txt -> mydir/myfile.txt'.

Now using git commit command create this restructuring permanently within the repository.

If we move file/folder out of the working directory (basically like permanently removing a committed file from the repository) then post movement we have to use 'git add -u' command to mark it staging then commit command to create it permanently.

answered Nov 26 by anonymous
• 40,980 points

Related Questions In DevOps Tools

0 votes
0 answers

How do you restructure working directory files in a git repository?

How do you restructure working directory files ...READ MORE

Nov 26 in DevOps Tools by anonymous
• 6,650 points
12 views
+1 vote
1 answer

i have a pyhton code in my git/git repository how to build that code in jenkins

Follow these steps @Bhaskar: Step 1: Open the Jenkins ...READ MORE

answered Oct 14 in DevOps Tools by Kalgi
• 45,780 points
33 views
0 votes
1 answer

How do I find OpsWorks deploy user in a recipe ?

Here is a concept which you can ...READ MORE

answered Jul 25, 2018 in DevOps Tools by Atul
• 10,240 points
35 views
0 votes
3 answers
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
245 views
0 votes
1 answer
0 votes
1 answer

How to get the current status of a local repository in Git?

Using 'git status' command in the repository ...READ MORE

answered Nov 26 in DevOps Tools by Sirajul
• 40,980 points
11 views
0 votes
1 answer

What are the steps to unstage files and discard changes in the working directory?

If the git status command displays 'myfile.txt' ...READ MORE

answered Nov 26 in DevOps Tools by Sirajul
• 40,980 points
13 views