Showing posts with label GIT. Show all posts
Showing posts with label GIT. Show all posts

How to set git tag

 How to set git tag


$ git tag -a gittag_2021 -m "description"


#git #git tag 

Git Error : fatal: refusing to merge unrelated histories (with github)

Github git push error

 

Error list :

error: failed to push some refs to 'github.com:id/AutoTrade.git'

fatal: refusing to merge unrelated histories

 

command for issue )

git pull origin master --allow-unrelated-histories

 

This command option is used to store the history of a project that already exists. In other words, git basically rejects when merging two heterogeneous projects that do not have related records.

I think it got twisted somewhere because I repeated git add and git init.

The conclusion is solved.

 



 step )

kw@ig-ui-MacBookAir autotrade % git init

kw@ig-ui-MacBookAir autotrade % git remote add origin git@github.com:id/AutoTrade.git

kw@ig-ui-MacBookAir autotrade % git add .

kw@ig-ui-MacBookAir autotrade % git commit -m "first"

 

 

Error 1) error: failed to push some refs to 'github.com:id/AutoTrade.git'

kw@ig-ui-MacBookAir autotrade % git push origin master

To github.com:id/AutoTrade.git

 ! [rejected]        master -> master (non-fast-forward)

error: failed to push some refs to 'github.com:id/AutoTrade.git'

hint: Updates were rejected because the tip of your current branch is behind

hint: its remote counterpart. Integrate the remote changes (e.g.

hint: 'git pull ...') before pushing again.

hint: See the 'Note about fast-forwards' in 'git push --help' for details.

 

I didn't "git pull", so I think this issue occurred.

 

So, I did "git pull". -> Error 2 Step

 

Error 2) Merge made by the 'recursive' strategy.

kw@ig-ui-MacBookAir autotrade % git pull git@github.com:id/AutoTrade.git master

From github.com:id/AutoTrade

 * branch            master     -> FETCH_HEAD

hint: Pulling without specifying how to reconcile divergent branches is

hint: discouraged. You can squelch this message by running one of the following

hint: commands sometime before your next pull:

hint: 

hint:   git config pull.rebase false  # merge (the default strategy)

hint:   git config pull.rebase true   # rebase

hint:   git config pull.ff only       # fast-forward only

hint: 

hint: You can replace "git config" with "git config --global" to set a default

hint: preference for all repositories. You can also pass --rebase, --no-rebase,

hint: or --ff-only on the command line to override the configured default per

hint: invocation.

fatal: refusing to merge unrelated histories

 

… "git pull" is not executed… what the issue….

fatal: refusing to merge unrelated histories

 

Solve)

kw@ig-ui-MacBookAir autotrade % git pull origin master --allow-unrelated-histories

From github.com:id/AutoTrade

 * branch            master     -> FETCH_HEAD

hint: Pulling without specifying how to reconcile divergent branches is

hint: discouraged. You can squelch this message by running one of the following

hint: commands sometime before your next pull:

hint: 

hint:   git config pull.rebase false  # merge (the default strategy)

hint:   git config pull.rebase true   # rebase

hint:   git config pull.ff only       # fast-forward only

hint: 

hint: You can replace "git config" with "git config --global" to set a default

hint: preference for all repositories. You can also pass --rebase, --no-rebase,

hint: or --ff-only on the command line to override the configured default per

hint: invocation.

Merge made by the 'recursive' strategy.
 

 

kw@ig-ui-MacBookAir autotrade % git push origin master

Enumerating objects: 15, done.

Counting objects: 100% (15/15), done.

Delta compression using up to 8 threads

Compressing objects: 100% (13/13), done.

Writing objects: 100% (14/14), 7.16 KiB | 3.58 MiB/s, done.

Total 14 (delta 1), reused 0 (delta 0), pack-reused 0

remote: Resolving deltas: 100% (1/1), done.

To github.com:id/AutoTrade.git

   412ec51..2332532 master -> master

 

 

 

<pull option>

--allow-unrelated-histories

The conclusion is solved, so let's just use it. 

#git #github #issue #error #fatal: refusing to merge unrelated histories #python #c++ #c


Git Command

git init : create Git Repository in current directory
git status: check uncommit issue
git --version : check version
git add: update in staging area( staging area: buffer area between work tree and repository)
git commit: commit file in staging area
git diff : show different between work tree and staging area
git config (--global) --list: check config information(--global set global, besides current area)
git log: commit log
git log $CommitName: show log in CommitName
git clone $repo $folder: copy from $repo and $local folder
git fetch: update local repo(though remote branch)
git push: push origin repo
git gc: repo log optimization



ADDING....

GIT clone error / delete branch in remote repository

GIT clone Error

ERROR
fetal: internal server error
remote: internal server error
fatal: early EOF
fatal: index-pack failed

solution :
if 'origin' branch was delete in remote repo, local is update about the information and the branch is delete automatically. 

cmd:
  $ git remote prune origin

Apartment Buying Guide 2025: Shocking Red Flags You Should NEVER Ignore!

 🏙️ Apartment Buying Guide 2025: Shocking Red Flags You Should NEVER Ignore! 🚨 Are you thinking about buying an apartment in 2025? 🏢  It’...