Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

not be able to commit and push a project to GitHub

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

Clone worked

Got the files and the .git folder

Get worked

But when I push back by clicking the check mark (commit) nothing happens

Push NOT WORKING

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??

like image 810
zummon Avatar asked Nov 10 '20 03:11

zummon


2 Answers

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.

like image 136
Daemon Painter Avatar answered Sep 25 '22 13:09

Daemon Painter


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.

like image 41
VonC Avatar answered Sep 22 '22 13:09

VonC