Github - How to update my own repository? - github

I have a repository in my Github, and I cloned it on my desktop. Then I did some work in the folder. How do I commit those changes to my repository?

below code is right, but don't forget to add remote address to key "origin".
git remote add origin <YOUR_REPOSITORY_PATH>
git add .
git commit -m 'some change'
git push -u origin master
-u – sets repo branch as defaults, so then you can push, just git push

May
git add .
git commit -m "my changes"
git push origin master

Related

Not able to add remote repository

I want to push changes from my local repository to my github repo. I start with the commands giving from github quickstep:
git init
git add .
git commit -m "first commit"
and then
$ git add origin https://github.com/Svein-Tore/forrigling.git
fatal: pathspec 'origin' did not match any files
Any suggestions to what can be wrong?
You've to use git remote add origin https://github.com/Svein-Tore/forrigling.git
When you use git add origin, it tries to add the file 'origin'

Why I'm having problems pushing my first repo?

I'm trying to push my first repo to github but I got this error
git branch -M main
fatal: Invalid branch name: 'HEAD'
Could someone help me to fix the problem
git branch is a local command which does not push anything.
To avoid any issue, the easiest approach is:
git clone https://github.com/<me>/<myRepo>
cd <myRepo>
# report the work you did in your previous repo
git add .
git commit -m "First commit"
git push -u origin main

How to update code in gitlab

My team committed code to gitlab repository and I need to take those updates. I already clone the project into my local directory but didn't take update before.
For taking update what commands need to run. I already tried pull command and it shows the changed file details but that changes are not applying to the project. For apply the changes any new command needs to run again?
Run following commands for taking the update:
git fetch && git checkout master
git pull
git config --global user.name "demo"
git config --global user.email "demo#gmail.com"
Create a new repository:
git clone https://gitlab.com/demo_test.git
cd demo_test
git switch -c main
touch README.md
git add README.md
git commit -m "add README"
git push -u origin main
Push an existing folder:
cd existing_folder
git init --initial-branch=main
git remote add origin https://gitlab.com/demo_test.git
git add .
git commit -m "Initial commit"
git push -u origin main
Push an existing Git repository:
cd existing_repo
git remote rename origin old-origin
git remote add origin https://gitlab.com/demo_test.git
git push -u origin --all
git push -u origin --tags

How to push on my development branch on Github

I get an issue when I try to push on my development branch on Github. Actually, I forked the microscopejs repository to update some files...
Command :
git clone https://github.com/tonymx227/microscopejs.git
git add remote upstream https://github.com/tonymx227/microscopejs.git
git fetch upstream
// I updated some files using Sublime Text 2 here
git add . -A
git commit -m 'test'
git push origin development
Issue :
error: src refspec development does not match any.
error: failed to push some refs to 'https://github.com/tonymx227/microscopejs.git'
You haven't create a local development branch.
You only have the remote tracking branch origin/development after your clone.
Do first a:
git checkout -b development origin/development
Then:
git add . -A
git commit -m 'test'
git push -u origin development
Note: you don't need the git remote add upstream step.

how to code commit on github using MINGW32?

i created a repositories on github.
now i want to put my some code there can anybody tell me how to do this and how to commit code.
i tried using this lines
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/Dany001/myrepo.git
git push -u origin master
please short out my problem
Thanks