Push your local directories to GitHub

Individual with a diverse skill set in the blockchain, frontend development and security and proficiency in Data Structures and Algorithms. Skilled in Java, Python programming. Adaptable to multiple technologies and platforms, with a passion for staying abreast of emerging trends and technologies.
Assuming you are ready with your project directory and wanted to push into your github repository.
- Initialize directory with git
git init -b main - Add to staging and perform commit
git add . && git commit -m "intitial Commit" - But you are unable to push the changes. You need to create the repo before pushing. You can perform this using https://cli.github.com/
- Install gh into your machine
sudo apt-get install gh - Then create repo using command
gh repo create - Oops! is it asking for authentication. haha :) stay conscious. Now run the command and specify required feilds
gh auth login - Rerun step 5. Specify Repo name, Desc, Visibility, and if you want to a remote name it something like
origin. It initializes push commits to origin. - Thats it. You are done. But is that really help in all cases? If yes end your reading here and if not you might faced the same thing what I've faced.
exceeds GitHub's file size limit of 100.00 MB
Usage of git-lfs
Ofiicial docs: https://git-lfs.github.com/
Installation
sudo apt install git-lfs
Track files
git lfs track "*.pkl" "*.csv"
Add .gitattributes
git add .gitattributes
Add files to stage and commit
git add . && git commit -m "large_files"
Push the changes to branch
git push origin -u main
failed !
! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/Username/project.git'
Googling got me through this: https://stackoverflow.com/questions/33330771/git-lfs-this-exceeds-githubs-file-size-limit-of-100-00-mb
Try migrating large files
git lfs migrate import --include="*.pkl"
git lfs migrate import --include="*.csv"
and push to git.
git push origin -u main
I'm done with my requirement and hope the same with you. ๐ง๐ค
If not google is your saviour. Thanks for reading till the end. Bye ๐
![1.1 Fallback hands-on [CTF][Blockchain Security]](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1672718383287%2F34bacb82-632f-4b61-82e8-a1a2bb32d17e.png&w=3840&q=75)
![1.0 Fallback [CTF][Blockchain Security]](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1672493957663%2Fed55879e-c39d-4989-932f-05414168ddbc.png&w=3840&q=75)

![Git and Github [guide for developers]](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1664528916517%2FFq77C-mD8.png&w=3840&q=75)