Python Forum
Forcing a github push after major changes
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Forcing a github push after major changes
#1
I cloned a repository (my own) to may computer.
I then created all of the parts required for a package that I could add to PyPi
including renaming some python modules.

Now, with all the changes in place, I want to force  a push back to github.
I tried the following (from the copy on my computer):
git push https://github.com/Larz60p/CaliforniaPublicSalaries --force
and received the following message:
Output:
Everything up-to-date
I am a novice at this, and am thinking my command might need more information

Also, I'd like to create a stand alone executable (still keeping the source) and like that to be part of the distribution.
Reply
#2
Hi, have you done "git commit" first, before doing "git push"?
Or maybe check that you are on the right branch (some "development" branch, or master).
Reply
#3
Got:
Output:
λ git commit On branch master Your branch is up-to-date with 'origin/master'. Changes not staged for commit:        deleted:    LICENSE        deleted:    README.md        deleted:    __init__.py        deleted:    screenshot.png        deleted:    src/CaCompGui.py        deleted:    src/UpdateCatalog.py        deleted:    src/__init__.py Untracked files:        build/        dist/        pip-selfcheck.json        pyvenv.cfg        setup.cfg        setup.py no changes added to commit
I don't like the deleted list either. I need to take another look at this before I proceed.
Reply
#4
It seems that you have your files untracked, so you need to add files first, after that you can commit them into the repository.  Try 
Output:
git add . git commit
in your directory before pushing.

EDIT: I have overlooked your other questions. I am not a big git expert, but from my understanding if you move or rename files/directories, from git's point of view they disappeared (so git status lists them as deleted), while renamed/moved files are untracked by git and you need to add your changes with git add . . After that you can commit and push your changes.

Git has no problems with binary files, actually it doesnt care at all - even for text files git just computes sha-1 for files and if it changes, git saves entire file (in his internal compressed format). So you can put your binary into the repository and add and commit.
Reply
#5
Thanks. I have avoided packaging files in the past, only because it seemed to be a bother
I now have 9 repositories, each of which should be packaged.
Tutorial information for this subject tends to be sparse, or at least I don't seem to be finding
the one that works for me.
I thought I saw (or perhaps I wished I saw) a blurb about changing basic directory structure
and being able to force it into github.
I'll play with add today.
Reply
#6
Quote:Changes not staged for commit:
       deleted:    LICENSE
       deleted:    README.md
       deleted:    __init__.py
       deleted:    screenshot.png
       deleted:    src/CaCompGui.py
       deleted:    src/UpdateCatalog.py
       deleted:    src/__init__.py
These are files that you removed on your local repo, but they still exist on the github repo as it hasnt been updated yet.

Quote:Untracked files:
       build/
       dist/
       pip-selfcheck.json
       pyvenv.cfg
       setup.cfg
       setup.py
These are files on your local repo, that are not on the github repo.

The following will update your repo assuming you are using master and not a branch
git add .
git commit -m "I updated blah blah"
git push origin master
After this your local and github repo should be in sync.


EDIT:
Why do you have the URL in the command? Did you ever connect the directory with the github repo? Should be something like... git remote add origin https://github.com/Larz60p/CaliforniaPublicSalaries.git

I made a tut with the basics of initializing and adding files to a repo. Not much after that, was just trying to get people to use repos instead of posting multiple files on the forum  Smile. But it includes what you are doing here. 
Recommended Tutorials:
Reply
#7
Thanks metulburr.
Will let you know how I make out.
Also, I will make an executable for windows, should that be part of the package or not?
Reply
#8
Some people will complain. They want you to add them in releases or add a script to generate an exe, etc. But there is nothing stopping you from adding them in alongside your code. I in-fact prefer to add them with my code as it makes it easier for people in my opinion.

an example:
https://github.com/justinmeister/Mario-L...50b18dd6b8
Recommended Tutorials:
Reply
#9
(Mar-30-2017, 11:54 AM)Larz60+ Wrote: Also, I will make an executable for windows, should that be part of the package or not?
It depend on the prospect an the users it targeting.
Some project it make no sense to make a "exe" for,an for other prospect it can make a lot of sense.
I have "exe" releases for all version of my Norwegian Tv project.
For Linux versions i have Read_me how to install.

I have a lot Windows user that do not know what Python is(they guess a Snake) or that OS has command line.
They would never had used my project if i had to a Read_me for Windows like eg(install Python, FFmpeg, WxPython and many 3-party modules).
Reply
#10
If you're on Windows/Mac, I highly recommend Github Desktop. It watches for new files, adds them automatically (with checkboxes so you can avoid committing them if you don't want), and it has a diff panel so you can view all changes before committing them. Instead of push/pull, there's a single "sync" button in the top right... so you can continue to work locally if that's how you prefer.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Forcing matplotlib to NOT use scientific notation when graphing sawtooth500 4 232 Mar-25-2024, 03:00 AM
Last Post: sawtooth500
  Recommendations for IMAP Push/IDLE library MikeFlorida 0 774 Jul-15-2023, 05:19 PM
Last Post: MikeFlorida
  Push video to left and remove background finndude 12 1,795 Dec-13-2022, 10:42 AM
Last Post: finndude
  I need advise with developing a brute forcing script fatjuicypython 11 4,929 Aug-21-2020, 09:20 PM
Last Post: Marbelous
  neeeed help major hussruss253 0 1,248 Dec-24-2019, 06:20 AM
Last Post: hussruss253
  Forcing input from pre-defined list. scotty501 11 5,999 Jun-18-2019, 01:49 PM
Last Post: scotty501
  Why doesn't gc delete an object without forcing a garbage collection call? AlekseyPython 5 3,714 Mar-19-2019, 02:10 AM
Last Post: micseydel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020