'Git/개인'에 해당하는 글 3건

Pycharm 에서 commit을 하는데, git 계정이 두 개여서 다른 user로 바꾸고 싶었다..!

 

 

 

다른 계정으로 commit을 하니까 메인 계정에서 git contribution에 반영되지 않았기 때문!!! 실제 한 달 간 django project를 하면서 commit을 굉장히 많이 했는데 하나도 반영이 안됐다! ㅜㅜ

 

방법

pycharm 터미널에서 간단한 명령어를 통해 해결할 수 있었다!

(venv) git config user.name
[현재 유저이름]
(venv) git config user.email
[현재 이메일주소]
(venv) git config --local user.email [바꾸고 싶은 이메일 주소]

 

나의 경우에는 ... 이메일 주소만 바꾸니 원하는 계정 정보로 이용할 수 있었다! (알고보니, 이메일 주소를 바꿔서 다른 계정으로 연결되었던 것... 같다...ㅎ) 

 

'Git > 개인' 카테고리의 다른 글

[Git 관리] commit 취소하기  (0) 2020.11.02
[Git 관리] Git 이전 commit으로 돌아가는 방법  (0) 2020.10.29

WRITTEN BY
choco-songyi

,

방법 두가지

- git reset

  - git reset --hard ...

  - git reset --soft ...

- git revert

 

상태& 하고 싶었던 것 

- 커밋했지만, 아직 push하지 않았음.

- 이전 커밋을 취소하고 리드미를 변경하여 커밋하고 싶음.

 

선택한 방법 

- git reset --soft HEAD~1

 

참고

gitabout.com/8

 

Git commit 되돌리기 명령어 Reset 과 Revert

Git 커밋(commit) 이력 되돌리기 이미 커밋(commit)된 작업 이력을 이전으로 되돌려야 하는 상황은 항상 발생합니다. 작업중에 실수로 올라간 커밋일 수 도 있고 버그나 오류가 포함된 커밋 일수도 있

gitabout.com

 

'Git > 개인' 카테고리의 다른 글

[Git 관리] user 변경하기  (0) 2020.11.10
[Git 관리] Git 이전 commit으로 돌아가는 방법  (0) 2020.10.29

WRITTEN BY
choco-songyi

,

1. git checkout HEAD~{n번째 전}

(venv) C:\Users\user\PycharmProjects\DjangoProject\insta>git checkout HEAD~1
Note: checking out 'HEAD~1'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 5ba51da little change
M       api/__pycache__/__init__.cpython-38.pyc
M       api/__pycache__/urls.cpython-38.pyc
# ...생략...

- 결과 : HEAD가 바로 이전 커밋으로 돌아갔음. 

- 확인 : 이전 커밋 해시번호 (5ba51da5)로 돌아갔음

2. 체크아웃했더니 서버로부터의 pull이 또 실패...ㅎㅎ => master로 다시 돌아오자...

(venv) C:\Users\user\PycharmProjects\DjangoProject\insta>git checkout master
Previous HEAD position was 5ba51da little change
Switched to branch 'master'
# ---생략----

Your branch and 'origin/master' have diverged,
and have 1 and 5 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)

 

'Git > 개인' 카테고리의 다른 글

[Git 관리] user 변경하기  (0) 2020.11.10
[Git 관리] commit 취소하기  (0) 2020.11.02

WRITTEN BY
choco-songyi

,