Git command to commit a local replaced project to remote master
I am a total newbie on github. Now I am facing a problem which is:
I uploaded my new project to github,with a same repo name as the project folder.
Then I messed up the codes on local,want to recover the version I uploaded to github. Without knowing how to do so with github desktop client or git command, I deleted the folder from my local(laptop), then download the github copy and place it in the same directory.
Now I have some update in my codes and I want to upload my newest version to github, commit to master branch, but I cant find the way to do so with desktop client or command. I tried to directly upload the whole folder to github website but cannot because the folder have exceed upload limit of website upload: more than 100 files inside.I also tried git command like:
git push fypsubmission master fatal: 'fypsubmission' does not appear to be a git repository fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
Please let me know what should I do, thanks
See also questions close to this topic
- Dark theme for git gui
Issue on git repository creation and accessibility using git
I had created created repository in
$sudo git --bare init /var/repos/git/repo00001
Also I have done following commands executed for individual
$ git config --global user.email "MyfullName@mindtree.com" $ git config --global user.name "Anand Sadasivam"
Under which directory I should be creating
git repsitories, I have issue while check-in files. What should be the permission, user, group needs to be set for directory
/var/repos/giton under which I am creating git repositories. At present its done under root privilege. Do I need to create separate
gitexclusively or any specific step or git command I have to follow to create user first before creating repository with
I had observed
initcreated some basic structure under
git repository. But when I did
git clonemy repository was empty.
Since I had used
--bare, I could see folder structure created as follows,
# ls HEAD branches config description hooks info objects refs
Following are the commands I have done at
git bash client sidein
Windowsfor initial check-in of some file,-
$ git clone email@example.com:/var/repos/git/repo00001 Cloning into 'repo00001'... firstname.lastname@example.org's password: warning: You appear to have cloned an empty repository. <<I had created Readme.txt file under the present directory>> $ git add Readme.txt $ git status On branch master $ git commit -a [master (root-commit) 8201309] Initial commit Committer: Anand Sadasivam <MMyEmpID@mindtree.com> Your name and email address were configured automatically based on your username and hostname. Please check that they are accurate. You can suppress this message by setting them explicitly. Run the following command and follow the instructions in your editor to edit your configuration file: git config --global --edit After doing this, you may fix the identity used for this commit with: git commit --amend --reset-author 1 file changed, 1 insertion(+) create mode 100644 Readme.txt $ git push origin master email@example.com's password: Counting objects: 3, done. Writing objects: 100% (3/3), 240 bytes | 120.00 KiB/s, done. Total 3 (delta 0), reused 0 (delta 0) error: remote unpack failed: unable to create temporary object directory To xx.xx.xx.xxx:/var/repos/git/repo00001 ! [remote rejected] master -> master (unpacker error) error: failed to push some refs to 'firstname.lastname@example.org:/var/repos/git/repo00001' $ git show-ref 82013098f6801ea32bb620b612f779c8dade6d83 refs/heads/master $ git push origin HEAD:master email@example.com's password: Counting objects: 3, done. Writing objects: 100% (3/3), 240 bytes | 120.00 KiB/s, done. Total 3 (delta 0), reused 0 (delta 0) error: remote unpack failed: unable to create temporary object directory To xx.xx.xx.xxx:/var/repos/git/repo00001 ! [remote rejected] HEAD -> master (unpacker error) error: failed to push some refs to 'firstname.lastname@example.org:/var/repos/git/repo00001'
Is this situation had arisen because
Windows Settingsbeen followed while
git bash/gui clientinstallation.
Or it is completely
repositorypermission issue or
repository creation userissue in
GitHub:When resolving merge conflicts through GitHub Web Editor UI, Git is merging changes on both branches
Step to reproduce:
- create readme file in master branch
- create dev branch
- modify line in dev branch
- modify same line in master branch
- create pull request master from dev
- resolve conflict using GitHub Web editor UI and keep both lines as the conflict resolution; mark as resolved and commit.
- merge pull request.
- Check file in master; it will show you that it has the right conflict resolution.(AS EXPECTED)
- check file in dev branch it should contain old files in dev but it has same file as in master; dev branch is also obtaining the conflict resolution which is NOT EXPECTED because the changes are moving from dev to master but GitHub automatically commits with the following message: Merge branch 'master' into dev
Delete files tracked in git stash and then git stash pop
git stash. I then did
git stash popbut got the following error:
error: Your local changes to the following files would be overwritten by merge: [proj].xcodeproj/project.xcworkspace/xcuserdata/[user].xcuserdatad/UserInterfaceState.xcuserstate Leaflet-[proj]/Leaflet.xcodeproj/xcuserdata/[user].xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist Please commit your changes or stash them before you merge. Aborting
I committed my changes. I tried
git stash popagain to no avail. I then removed the files with
git rm --cachedand committed those deletions.
git stash popnow gives
error: refusing to lose untracked file.
Your branch is ahead of 'origin/temp' by 2 commits. (use "git push" to publish your local commits)
Unmerged paths: (use "git reset HEAD ..." to unstage) (use "git add/rm ..." as appropriate to mark resolution)
deleted by us:
[proj].xcodeproj/project.xcworkspace/xcuserdata/[user].xcuserdatad/UserInterfaceState.xcuserstate deleted by us:
Can I invoke circleci for pytest such that any new pull requests must not decrease code coverage?
I'm interested in setting up my
config.ymlfor CircleCi such that any new pull requests (in order to pass) must
- Have all tests pass
- Must not decrease code coverage from master (either stay the same, or increase it).
Currently our setup just confirms that all tests pass.
I find circleci setup a bit challenging and haven't found any great explanations online.
- Using CircleCi version 2
- Using the pytest testing framework
- All of this is integrated through github
Any help would be very appreciated! I'm happy to clarify any points/post any code that could be helpful.
Github and git show different changes for a commit
I have a commit in a PR that I need to revert. Github shows a ton of changes for the commit, but git shows just a few. I cannot find the changes that Github shows---the ones I need to revert---locally. Github commit linked above; local changes below. What am I missing?!
$ git show --name-only fc44285b630a2152f41f000195ec8f76bca7658c commit fc44285b630a2152f41f000195ec8f76bca7658c Merge: b626839 1d24d68 Author: xxxx Date: Wed Apr 18 21:31:26 2018 -0400 site updates docs/dev/articles/site_only/healthcareai.html docs/dev/articles/site_only/transitioning.html docs/dev/index.html docs/dev/reference/evaluate.html docs/dev/reference/figures/README-plot_predictions-1.png docs/dev/reference/machine_learn.html docs/dev/reference/plot.predicted_df-2.png docs/dev/reference/predict.model_list.html docs/dev/reference/step_date_hcai.html man/figures/README-plot_predictions-1.png
github pushing a folder to repo
As you guys can see on the photo on "Gooogle" every time I commit and push that folder which contains files it goes like that and cant even click on it and can't seem to find a solution anywhere does anyone know the solution?
Git repository cloning timed-out error 443
I have downloaded the git and set name and email variables. When trying to clone the repository, facing 443 timeout issue. I am using a corporate machine, can this be the issue. Also, the http.proxy in git-config is null, is it required to set it to system IP?
Below error is faced:
fatal: unable to access 'https://github.com/XXXXXXXX/XXXXX.git/': Failed to connect to github.com port 443: Timed out
I found a post asking to use :
git config --global http.proxy http://proxyUsername:proxyPassword@proxy.server.com:port
What is proxyUsername, proxyPassword,proxy.server.com, port here? Where can I check these in my machine? (Windows 7)
How do you setup authentication with the GitHub client?
I am new to GitHub and have been in the process of uploading projects that I have worked on over the years to it.
Unfortunately, I have started to encounter this error whenever I want to publish more projects.
This error persists even on my laptop.
If someone could help me out, that would be great.
$ git commit --amend not altering/saving commit message
$ git add .some changes I made to one of my repositories followed by
$ git commit -m'INcorrect commit message'.
I decided to change the incorrect commit message to 'Correct commit message' using:
$ git commit --amend
The instructions I followed to do this can be found here: https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages
I use Atom, so Atom opens with 'INcorrect commit message' displayed, which I change to 'Correct commit message' and save my changes.
After I saved the altered commit message, I did a
$ git log -1expecting to see 'Correct commit message'; however, I still see 'INcorrect commit message.'
What exactly am I doing wrong?
Just prior to this, I changed my git editor from Sublime to Atom following these instructions: How do I make Git use the editor of my choice for commits?
I basically used:
$ git config --global core.editor "atom"
$ export GIT_EDITOR=atom
I realize now that I didn't have to do both, but I also realize this probably didn't hurt either.
Implementing a new "git ..." subcommand as a Python script
I feel like this question could be answered with one or two hyperlinks; I'm just not coming up with the right search terms to find those links myself...
I'm trying to make some minor changes to the
git p4subcommand, which is implemented as a 3797-line Python script named
/usr/libexec/git-core/git-p4. Before wading into the code too much farther, I'd like to get a sense of how a Python
gitcommand is structured.
What information does the subcommand get from its caller? What environment variables can it rely on existing? How does it detect the configuration (from
~/.gitconfig)? How are git command-line options passed down from
git(in case there are command-line options common to many different subcommands and you want to make sure their handling is centralized)? What is the current working directory at the time the subcommand is launched? What happens if I change the cwd? How do I communicate back to
gitthat it should change the repo (make commits, add or delete tags, rewrite history) as part of the functionality of my new subcommand? Can my command "work on" the index directly without making a working tree, and if so, how? How do I handle and report errors? How do I print usage information in a consistent way?
I assume there must be blog posts and things about this topic, but searching "write a git subcommand in python", "create new git subcommand", etc., just turns up ways to run existing git commands from Python and ways to create new git repos, respectively.
I'm running this command as a part of SVN-GIT $gitcommit = $gitcommit.ToString() through my script but.. its throwing an error
git checkout origin/trunk $gitcommit = git log -1 --all $gitcommit = $gitcommit | select-string -Pattern "git-svn-id" $gitcommit = $gitcommit.ToString()
Error as follows :
- $gitcommit = $gitcommit.ToString()
- CategoryInfo : InvalidOperation: (:) , ParentContainsErrorRec ordException
- FullyQualifiedErrorId : InvokeMethodOnNull
I don't understand what is wrong with this line.. it worked fine sometimes.