Steps:
1. Create an account in GitHub or GitLab
2. Now download and install GIT on your pc. link
3. Now go to the project directory or the file you want to upload
4. “Right-click” in the folder. so that you can see “git bash here” and “git GUI here”.
5. Click on “git bash here” . and a terminal will open.
6. Now use these commands:
- git config –global user.email “your_email@gmail.com”
- git init
- git add [file name] or git add * — to add all file in the directory
- git commit -m ‘first commit’
- git branch -M main
- git remote add origin htttps://github.com/your_username/your_distination_repository_ in_github.git
- git push -u origin main
7. That’s it if you see in your github account repositories you can see all the fie been uploaded.
top 20 commands in git:
- git config
- git init
- git clone
- git add
- git commit
- git diff
- git reset
- git status
- git rm
- git log
- git show
- git tag
- git branch
- git checkout
- git merge
- git remote
- git push
- git pull
- git stash
Reference: https://dzone.com/articles/top-20-git-commands-with-examples
One thought on “How to upload code into GITHUB repositories?”