Git: Difference between revisions

From DWIKI
Line 35: Line 35:
and to get back
and to get back
  git checkout master
  git checkout master
or was it
git checkout


= FAQ =
= FAQ =

Revision as of 14:19, 31 January 2024

Links

Documentation

Cheat sheet

Create repository on server

mkdir -p git/myproject
cd git/project
git init --bare


browse local repository

git ls-tree --full-tree -r HEAD

push as different user

check .git/config and replace username


Switch to particular branch

git branch -a
git checkout remote/releases/6.4

and to get back

git checkout master

or was it

git checkout

FAQ

Restore single file

Move the file away and

git restore yourfile

Automatic merge failed; fix conflicts and then commit the result.

Try

 git mergetool

error: src refspec master does not match any.

ye well, screw you. you did something wrong!

 

error: Merging is not possible because you have unmerged files.

This is not a joke!

fatal: cannot do a partial commit during a merge.

git commit -i

error: Pulling is not possible because you have unmerged files

error: Your local changes to the following files would be overwritten by merge:

move the file away and try again?



list untracked files

git status

Changes not staged for commit:

File has to be added again

 

error: gpg failed to sign the data

try

GIT_TRACE=1 commit ...

and run the command it suggests

but your problably forgot to

 git config --global user.signingkey  XXXXX

You have divergent branches and need to specify how to reconcile them.

First try:

git merge