Why GIthub Folder Button broken? - html

I git pushed my projected to my Github page,
but a few important folder didn't seem to work and can't see the content.
And even when I download all folders in zip file, still nothings contained in it.
I mean, the start folder should contain all of my files and activated.
The original folder has full content, so I have no idea what to do.
Noghing errors thrown while I push those to Github.

The original folder has full content, so I have no idea what to do
The original folder start also has a .git/ subfolder in it.
That makes start a nested Git repository, which will be pushed to GitHub as this "gray (empty) folder", representing a "gitlink" (a special entry in the index), which is the nested repository root tree SHA1.
You would need to:
git rm start # no trailing stash
rm -Rf start/git # if you don't care about the start history
git add start
git commit -m "Add start content"
git push

Related

Cannot push to github because of large files

I am getting this error shown in the screenshot below when I try to push to Github.
I have removed any video files that were added in the previous commit using the 'git rm --cached ' command, however it is still complaining about video files begin too large, even though I have removed them from the commit... please help!
I have tried to add the mp4 files to my git attributes file so that they will be stored in Git Large File Storage, but still no joy.
I am relatively new to git and the git process but I have never had this problem when pushing files. Please help me as I cannot push anything up to github, thanks!
You can use git filter-branch command in-order to remove a big file which is wrongly committed in git
git filter-branch --tree-filter 'rm -rf path/to/your/file' HEAD
You basically need to remove the bigger files from Git history so that they are not pushed, but not from the file system.
If you mistakenly push the file in your previous commit, you can do:
git rm --cached giant_file # Stage our giant file for removal, but leave it on disk
git commit --amend -CHEAD # Amend the previous commit with your change
git push # Push our rewritten, smaller commit
If not, they recommend using BFG – repo cleaner tool for cleaning up repositories:
bfg --strip-blobs-bigger-than 1M #removes files above 1 MB

Untracked Files on Terminal

A quick question of people on StackOverflow.
I am trying to push to GitHub but I made a mistake where I added all of the wrong files to my GitHub page.
This leads me to not push my code on the terminal and I also cannot push my code onto a website used by Namecheap.
Does anyone have solutions/recommendations towards how they can fix the problem and make sure the terminal command is clear of untracked files?
Below screenshots contain the errors.
I see 2 problems.
1) Looks like you cloned your repo in home directory. Due to this git is seeing all files unrelated to your project.
2) I guess you did not want to commit files under todolist and tried to delete them.
I can suggest below solution.
a) Create a directory like ~/project/code/git and clone your repo again to that path.
b) Merge all required changes from previous path into newly cloned repo.
As you don't want to push todolist to github, you can move it to ~/project/docs/todolist.
Alternately, you could use .gitignore to "tell" git to ignore todolist folder, but I would recommend docs folder option.
Hope this will solve your issue.
There is a git repo in your home directory. Try this:
Remove .git folder in your home directory which cause the problem
rm -rf ~/.git
Clone your repo into another directory
Copy and overwrite all of your modified files
Push your changes

Why isn't my push to git working on my Bootstrap template?

I am new to Bootstrap templates as well as Git. I made a github.io site, but when I pushed my code to git and open my site, my formatting is all wrong. When I open it through my browser, it looks how I want it to. Why isn't it formatting properly? What's happening?
Check your project for below scenario
Check and confirm you push to proper Branch
Check .gitignore file from your project root directory
Example
PATH\TO\YOUR\PROJECT\.gitignore
.gitignore file is look like
/vendor/*
/tmp/*
/logs/*
/img/downloads/*
That mean git will not push those files to your remote branch.
If .gitignore file have some directory to skip git tracking, Then remove the directory/files to allow tracking
After done! Try below command from your git command line.
git rm -r --cached .
git add .
git commit -m "Type Your Commit Message Here"

hg: replacing directory contents in one change

With hg, how can I replace the contents of a directory in one change?
More specifically, I have headers for a large C++ library checked into my repo and I'd like to update them (including adding and removing files) to the latest version of the library. And I'd like to do this in one change, rather than first a removal of the old version and then addition of the new, which would break tests and produce unhelpful diffs.
Within your mercurial repo:
# Change to parent directory of your vendor directory
cd vendor_dir/..
rm -rf vendor_dir
# unpack/copy/checkout new vendor sources into a new vendor_dir
# Tell mercurial to figure out what changed
# Feel free to play with the similarity percentage and the (-n) do nothing switch
hg addremove --similarity 70 vendor_dir
hg commit vendor_dir
Updated:
Changed to work on the parent directory since hg rm * within vendor_dir misses dot files, if any.
Change from hg rm to rm -rf because I wrongly assumed that addremove after rm would do the right thing. Hint: it doesn't.
Realized that the default similarity of 100% is not appropriate for vendor releases.
If they are all changed then, (assuming a flat directory structure:
hg remove \path\to\directory\to\replace\*.h
copy \path\to\new\files\*.* \path\to\directory\to\replace\
hg add \path\to\directory\to\replace\*.*
hg commit -m "Library SoAndSo headers replaced"
hg push
The first line says forget all the files on the next commit but then the new ones are added in the same commit - remember only the last but one line actually changes the local copy of the repository and it only becomes public on the last line.
If you do have sub-directories then you can just remove the *.h on the first line, use xcopy or explorer to copy the new directory structure into place and remove the *.* on the 3rd line.

Hg: How to move files (to subfolder) without losing history?

How to move files (to subfolder) without losing their history?
In my Mercurial repository (I mean the folder with the .hg in it) I have MyProject/ folder with all project files. Now I need to create src/ folder inside and move all files to it (from MyProject/ to MyProject/src/). How can I do it without losing all history?
Since you have a "tortoisehg" tag, I figured I'd explain the way I do this using the GUI.
Usually, I just rename/move files in my IDE, or from windows explorer, then when I go to commit, THG will show a bunch of (?) unknown files and (R) removed files. Just right click on any of the files and choose "Detect Renames...", then click the "Find Renames" button.
You might have to adjust the "Min Similarity" slider until you get all the files you want and only the files you want, but it's usually very straightforward.
hg mv
does do the right thing, but hg log does not list entries past the move unless you
give it the -f option. See this question for more info
Why 'hg mv' (mercurial) doesn't move a file's history by default?
After you do this, you likely want to add the -f option to hg log
to the hgrc file for the repo.
.hg/hgrc
[defaults]
log = -f
In Windows with Tortoise HG installed, there is a windows shell extension that handles this very nicely.
In Windows Explorer, simply right-click and drag the file(s) you wish to move into the destination folder. You are then presented with a pop-up that give you these choices:
HG Move versioned item(s) here
HG Copy versioned item(s) here
Use hg mv to move your files and then use hg log -f (follow) to see history including renames.