How to push empty folder to AzureDevops through visual studio - azure-devops

I tried few times and failed to push empty folder, any way to push empty folder to azdo from VS.

For this issue, in Git, you cannot commit empty folders, because Git does not actually save folders, only files. You'll have to create some placeholder file inside those directories if you actually have no committable content.
You can refer to this How can I add an empty directory to a Git repository? and this official document.

You can add .gitkeep file inside this directory.

Related

How to recover files from .gitignore

while uploading files to the repository in GitHub, I accidentally click to the button to ignore the files from the upload. Now these files are in a folder called '.gitignore'.
How can I recover these files?
I'm able to see and modify them, I just want to know how to upload them in the repository.
Thanks in advance
I think you misunderstand the concept of .gitignore "folder".
It is instead a text file, with the path of the ignored directories or files.
Consider the following .gitignore file.
foo/bar.txt
foobar/
This will tell git to ignore the directory foobar as well as the file foo/bar.txt, and therefore you won't be able add the files to a commit or push it to a remote repository.
But you can simply remove a file from the list of ignored files and directories by opening the .gitignore file, deleting the line with the corresponding file and saving the .gitignore file. You then should the be able to add the file to a commit and push it to a remote repository.
More information about .gitignore can be found here

How to add an empty folder inside an already existing repository? Github [duplicate]

This question already has answers here:
How do I add an empty directory to a Git repository?
(37 answers)
Closed 2 years ago.
In GitHub, I already have an Automata repository with 1 project in it. I just want to add more projects in this repository. I wish to create different folders inside the Automata repository so I can better organize my projects. In other words, my question is "how to add a folder inside a repository?"
An empty directory cannot be part of the git versioning system. But you can use a little workaround.
You can add a .gitignore inside your empty directory. Add these lines:
#Ignore everything
*
#dont ignore this file
!.gitignore
The * will assure that no files in this directory will be tracked. However, as you probably want to add files later, you shouldn't put the star in. Therefore your .gitignore can be empty. You can add real files to ignore later, as your project grows.
To create the .gitignore type the following in your console:
$ mkdir $foldername
$ touch .gitignore
$ git add foldername/.gitignore
$ git commit -m 'added placeholder folder' $foldername
where you replace $foldername with the desired name of your folder.
Now you have a folder which is not completely empty, but only has one hidden file.
Github doesn't allow empty folders. You can make a folder and add a placeholder file to it and push that to your repository. That's the only way you would be able to create a new folder in your GitHub repo. You can't create a folder and then add files to it on GitHub, but rather the creation of folder must happen with a file inside that folder.
You can either push the folder through git commands. There's another option to directly drag and drop folders from your system to your GitHub repository.
To directly add a folder from the GitHub website, click on Create New File. Type in name of folder you want to create, add the file and Commit new file to add it. You can refer the below gif -

what Git Ignore field means in github desktop while creating a new repository

see the Git Ignore option in the below image.What I have to choose, I am creating an ionic-framework repository.
https://i.stack.imgur.com/pBvkd.png
.gitignore is a file which, Git uses to determine which files and directories to ignore, before you make a commit. These files/directories will not be pushed into the repository.
If you have any files or directories that don't need to be pushed into the repository, then you can include them. (a simple example : log files)
If there is no ionic option, you can ignore it, and create it locally on your repo, then push it back to your GitHub repo.
To create it, see https://www.gitignore.io/api/ionic3
It does generate an Ionic .gitignore for you.

how to rollback the ignore state of a file/folder in git using eclipse

accidently I set the ignore state for a folder in GIT in eclipse.
context-menu on the folder -> team -> ignore.
How can I activate this folder for GIT again ?
I guess it must be team -> add to index, but this doesn't work for me.
any help ?
Click Ctrl+shift+R and type .gitignore in eclipse.
Open the .gitignore file of respective project.
All the ignored file's path will be displayed here.
Now remove the paths of files which you want to unignore and save it.
Again the files will be back to its original stage and can be added to staging area.
Steps to make file unAssumed ignore
If you don't want your files to be ignored then do the following
Go to the file you don't want to be ignored and rightclick it --> Team --> Advanced --> No Assume Unchanged
Please find the same in image
See this bug right now there is no way to find all ignored resource in a git repo using EGIT.
When you do Team context-menu on the folder -> team -> ignore it will automatically create a .gitignore file inside the parent folder and this file is added automatically to git index and will be shown in git staging view.
After committing this file it is difficult to find all ignored resources in a given git repo. Go to your file explorer and search for all .gitignore files inside a git repo and view their content.
In the base directory of the git project, there will be a file called .gitignore (Note the dot at the start of the filename).
This file lists all the files, directories etc that are ignored by git.
Simply edit that file, removing the line which corresponds to the folder you accidentally added.

How to add all empty folders on git from local

How to add all empty folders on github from local
To add files we generaly use git add folder/subfolder/file.txt
but I want on folder like git add folder/subfolder/subfolder-2
You can't add an empty folder to git. Some people opt to create a .gitignore or a .gitkeep file inside the directory.