I have setup GIT on AIX 6.1 and am facing problems.
The sequence of steps I followed are as shown:
After performing all the steps above and give the git status
command I'm getting the foll result:
# On branch master
#
# Initial commit
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# ../index.html
# ./
I understand that index.html in the above directory is getting displayed but why doesent index-2.html not getting displayed which is in the current directory.
The file index-2.html should also get tracked right.
When you start a new repository, you typically want to add all existing files so that your changes will all be tracked from that point forward. So, the first command you'll typically type is "git add ." (the "." means, this directory. So, it will add everything in this directory.) I'll type "git add ." and press Enter.
You have to add the untracked files of the repository by using the “git add” command and run the “git stash” command to save the untracked file and clean the current directory for working by removing the untracked file from the repository folder.
To add and commit files to a Git repository Create your new files or edit existing files in your local project directory. Enter git add --all at the command line prompt in your local project directory to add the files or changes to the repository. Enter git status to see the changes to be committed.
Git Empty directories in Git Git doesn't track directories gitkeep" file inside the directory and let Git track that file. Git will now track the file build/. gitkeep file and therefore the build folder will be made available on checkout. Again, this is just a convention and not a Git feature.
The output shows two things that are currently untracked:
../index.html
– the index.html
file in the parent folder./
– the current folder, including all its contentsSo it does detect that you have an untracked file, but because it does know nothing about its folder as well, it just shows the folder to accumulate all its content.
If you add your files and make Git track them, they will show up correctly:
git add index-2.html
git add ../index.html
It is tracking the folder ./ which means the current folder. git doesn't (correct me if I'm wrong), care about subfolders at all. Meaning if you have a repository with the folder foo, which is already in the repository. You add a subfolder bar in foo, and create a file foobar.txt in foo/bar. Then you will only get:
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# ./bar
Which means that if you had done cd .. before your git status command, you would get:
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# index.html
# newfolder
even though you have a file inside.
The reason for this is that git tracks content, not files. Since index2.html actually is a content of the folder newfolder, and you are not tracking newfolder, git doesn't know that index2.html exists.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With