can't commit and sync in github - objective-c

First step, create a new project called "X2" by Xcode, and clicked
Source Control: Create git repository on My mac
Secondly, make a new git dir at another place for pushing by following command line
cd ~/documents/Temp
mkdir X2
cd X2
git init --bare .git
Thirdly, back to Xcode, add below under SourceControl > X2 > Configure X2 > Remote
~/documents/Temp/X2/.git
and then do some changes in the codes, then commit/push to X2/master(Create)
as of now, everything is ok, successfully.
Back to Github client, and ~/documents/Temp/X2 as a local repository, it already captured changes of push happened.
BUT, when click button of Commit & Sync, it said "no changes selected". click button "Edit" of push just happened, it shows:
Could not edit commit
Failed to reset repository to commit 1d42d81bc45dbec791f59a8c11ae719018c3469f.
Some screen shots for reference
Github client captured commit and push done in Xcode
The commit and push done in Xcode called "in"
click button Commit & Sync
click button Edit
So, my question is what happened on Github client? How to fix this problem?

Related

How to change the master username at git in WebStorm?

WebStorm tries to push my project to an account that does not exist anymore. How do I change it? I have already added the new account to WebStorm and it still tries pushing to the old account.
You can change it in Settings>Repositories.
Setting>General>Repository name>rename
The entry highlighted on the screenshot is the commit author. This information is written in the commit, and is not related to the account that is used to push the change.
Author is determined by git configuration. You can check and change it using CLI - git config user.name and git config user.email
To change the author of the commit in question you need to re-do the commit.
Make sure git user is correctly set in git config, then undo the commit, and commit changes again.
To push, WebStorm will authenticate using the account configured in Settings | Version Control | GitHub, or according to the ssh config if ssh access is used.

How to connect a project from IDEA to Gitlab

Is it possible to connect a project from IDEA to Gitlab?
There are no problems with GitHub, you specify a github account, then VCS-> Import into and it creates a project in your account. But with GitLab I don't see such a possibility. Maybe there is some way?
Or just manually throw it in there?
If all you want to do is create a project, that is as simple as pushing the repo. In GitLab, you don't have to create the project in the UI first. You can simply push directly to a project namespace that does not yet exist. The project will be created when you push to it.
Therefore, all you have to do is configure your git remote per usual, then push.
git init
git checkout -b main
echo "# My Project" > README.md
git add README.md
git commit -m "initial commit"
git push --set-upstream git#gitlab.com:namespace/myproject.git main
Then you'll see the message from the remote in the git console log
remote: The private project namespace/myproject was created.
In the JetBrains IDEs, you can simply configure the remote and push.
You only have define the remote ahead of time in the terminal. For example:
git remote add origin git#gitlab.com:namespace/project
Then in the IDE, when you go to push, you'll see the ability to push to the new remote/branch.
Then you'll also note in the git tab console you'll see the message from the remote that the project has been created.
Full integration for GitLab hasn't been implemented yet, but there is a feature request for that:
https://youtrack.jetbrains.com/issue/IDEA-109294
Meanwhile, you can create a repository in GitLab, then press Cmd/Ctrl+K and Click "Commit and push". In Push dialog there will be "Define remote" button - click on it and paste URL to GitLab's repository.
If it's HTTPS then you'll be prompted with username and password - enter them, alternatively you can enter Username and Personal access token (in password field)

unable to commit & push reverted commit to bitbucket from InteliJ UI

I am new to InteliJ + Bitbucket integration.
after clicking revert commit on specific commit I pushed before -
local file is changed to the way it looked before the commit
but
no files appears on the local changes window
while running git status command on the terminal getting:
You are currently reverting commit a3b1cd9.
(all conflicts fixed: run "git revert --continue")
(use "git revert --skip" to skip this patch)
(use "git revert --abort" to cancel the revert operation)
any idea if there is any way to progress with this situation via the Intelij UI to commit and push this reverting to bitbucket?
Solution was to click on push icon on top, and then popup with option to push the reverting commit is presented.
unlike regular commit that right after changing files all of them are ready to commit on local changes window, and push popup appears only after marking them and clicking commit button...

How do you set the commit message when editing a text file in a Visual Studio Teams Services git repository? (Visual Studio Online)

When browsing a repository under the "Code" tab of a project in Visual Studio Team Services. If I browse to a text file in the git repository and select it I see the contents of the file and I have the option to edit the file.
If I edit the file and then save it a git commit message is automatically generated, which is of the form "Updated PreBuild.ps" - if I edited the file Prebuild.ps
I like my git commit messages to be written in the future tense:
If this commit is accepted it will update PreBuild.ps to add some console logging
How do I either type my own commit message or edit the commit message after it has been created in Visual Studio Team Services?
You can enter the commit message by editing the string "Updated PreBuild.ps" directly before saving the updated file. And you can also click dropdown icon to add more detailed description if you want.
And there isn't anyway to edit the commit message from VSTS Web Portal, you need to pull the changes to local and use "git commit --amend" command to update the commit message and then force push it back to remote. You can refer to this question for details: Edit an incorrect commit message in Git

Tooltwist Designer Repository Sync is failing

When I sync from the ToolTwist Designer, I select the files I wish to publish, but I get an error when I press OK, saying that the sync failed and to look in the server log file.
If I try again, the files I selected are no longer in the list, but if I check Git I can see they are not pushed to the repository.
In the log file I see that the push failed, and if I go to the webdesign directory and test the push command I get the same error:
$ git push --dry-run
To git#github.com:MyRepository/design-project.git
! [rejected] master -> master (non-fast-forward)
I'm using the 'design' branch, so I'm not sure why an error is occurring on the 'master' branch.
In normal circumstances the Designer only uses a single git branch, normally named 'design'. The error message above indicates a conflict on the master branch.
It appears that changes have been committed to the master branch on the local machine but not pushed, whilst elsewhere changes have been committed to the master branch and have been pushed onto the remote repo.
To clear this conflict you'll need to checkout the master branch and do a pull to merge in the changes on the remote, and then the next push will work. Don't forget to change back to the design branch when you're finished.
[stop the Designer]
$ git checkout master
$ git pull
[resolve any conflicts]
$ git push origin master
$ git checkout design
[start the Designer]
By default git tries to push commits on all branches. In this case, you might find that the conflict on the master branch is preventing your web design changes on the design branch from being committed. To prevent this from happening, you can configure git's default behaviour to only push the current branch.
$ git config push.default current
You might also want to investigate why the master branch is being changed (and in two locations).