Can't pass the stage due to a large file

I’m stuck on Stage #CZ2.

I’ve accomplished the task but can’t push the changes.

Here are my logs:

Your push was rejected because the following files were larger than 1MB:
- ./cmd/myshell/main (2MB)

And here’s a snippet of my code:

package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

func main() {
	fmt.Fprint(os.Stdout, "$ ")
	input, err := bufio.NewReader(os.Stdin).ReadString('\n')
	if err != nil {
		fmt.Fprint(os.Stderr, "ERROR: ", err)
		return 
	}
	input = strings.TrimSpace(input) // to remove the \n
	fmt.Fprint(os.Stdout , input + ": command not found\n")
}

Hi @mennatawfiq, could you try removing the large file ./cmd/myshell/main from your repo by following this guide?

Let me know if you need further assistance.

It’s the main file!!!

@mennatawfiq Got it. There is no need to push the main file to our Git server. Our tester automatically rebuilds your code every time you push changes.

Let me know how it goes after you remove the main file.

still having the same problem even after removing the main file

Looks like the main file is still in your commit history.

An easier workaround:

  1. Save main.go to somewhere else.
  2. Delete the whole repo.
  3. Re-clone the repo from our server.
  4. Move main.go back.

Could you give this a try, and please let me know how it goes?

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.