Reputation: 986
I already have a project on GitHub and I'm able to clone and got the files as I wanted.
I'm using clone from
Got the files and the .git folder
But when I push back by clicking the check mark (commit) nothing happens
I usually upload files manually to GitHub website but my project is getting bigger, so..
Did I miss something about commit and push to GitHub??
Upvotes: 5
Views: 3063
Reputation: 328
I can see that you are using VS Code to clone and commit changes. I followed the below process and this works for me.
Hopefully this works for you as well
Upvotes: 0
Reputation: 2786
try to use terminal/gitbash .
Here command .
check your status - if you have any changes you see here
git status
git add . // for adding changes data to git
git commit -m "commit here"
git pull // check first you have any updated or not.
git push origin master // master replace your branch name
Upvotes: 0
Reputation: 1416
Usually, to have an overview of the changes you've made this command:
git status
is pretty useful and clean
And:
git log
to see the last commits made by you or other people
And then to add the files, and commit
git add [FILES]
git commit -m "Message.."
git pull
git push
Upvotes: 1
Reputation: 1323793
You need to go to to Settings -> Extensions -> Git -> Post Commit Command, and choose "push" from the dropdown.
Only then clicking the tick (commit) will trigger a push automatically.
By default, committing would remain a local operation.
Upvotes: 2
Reputation: 3470
Using git through a GUI usually adds confusion instead of being helpful. One should try to get the git basics right in the first place.
A normal routine should be the following:
1. Clone project
2. Checkout a working branch
3. Make changes
4. Commit changes
5. Push changes
This routine is usually expanded and is cyclic like so:
1. Clone project
# for each new activity
2. Checkout a working branch
# each day
2b. Git fetch // will get new content from remote, updates you on what your colleagues are doing
3. Make changes
4. Commit changes
5. Push changes
It appears in your case you didn't do at least one of these steps.
Please note that "uploading manually files on GitHub" is jargon for: "create new commit with a specified commit message and the files added to the staging area via GitHub GUI, sign off the commit with the GitHub user name and email".
This is important, since on your local machine you'll have to git pull
, otherwise you'll be creating commits on a diverging history.
This should be an explanation on "what to do" and "how you get in your situation in the first place". It is probably out of scope to add more details in this answer, but please do let me know in the comments.
Upvotes: 2