-
Notifications
You must be signed in to change notification settings - Fork 6
adanbh's solution for git_ex1 #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
AdanBhsas
wants to merge
1
commit into
main
Choose a base branch
from
git_ex1/adanbh
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| 1. create a file in branch main, that called "abc.txt". | ||
| 2. the file color in Pycharm's Project view is green. | ||
| 3. in terminal : 1. git add abc.txt | ||
| 2. git status | ||
| 3. git commit -m "adding some text" | ||
| the file color changed to white | ||
| 4. Append the line 2 to the end of abc.txt | ||
| 5. the file color in Pycharm's Project view is blue. | ||
| 6. git diff HEAD | ||
| 7. git diff --staged will list only the staged files. | ||
| 8. syntax error it should be "git diff --stage2" and "stage2" is an invalid option. | ||
| 9. in terminal : 1. git add abc.txt | ||
| 2. git status | ||
| 10. nothing, there is no change to compare with. | ||
| 11. git diff main | ||
| 12. Append the line 3 to the end of abc.txt | ||
| 13. no, git diff main show the new changes and git diff --staged show just the changes we staged | ||
| 14. the first one to show that we have to commit it , and in the second to staged the changes. | ||
| 15. 1.git restore --staged abc.txt | ||
| 2.git status | ||
| ====================================== | ||
| Resolve conflicts | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great |
||
| 1. run ./init.sh | ||
| 2. 1.git init feature/lambda_migration | ||
| 2. git switch feature/lambda_migration | ||
| 3.Merge branch feature/version1 into feature/lambda_migration | ||
| 4.Merge branch feature/version2 into feature/lambda_migration | ||
| 6. yes, Untracked file feature/ | ||
| ====================================== | ||
| Cherry picking | ||
| 4. config.json , .env | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great |
||
| ======================================= | ||
| Changes in working tree and switch branches | ||
| 2. creating a file take.txt and adding it th the index without to commit ( git add take.txt) | ||
| 3. git switch dev, the error message : "Your local changes to the following files would be overwritten by checkout: take.txt" | ||
| git suggested to commit the changes or stash them before switch branches. | ||
| 4. switching to feature/lambda_migration branch using PyCharm UI | ||
| 5. no | ||
| 6. no there is no take.txt in the branch ,Force Checkout button destroyed the file. | ||
| ======================================== | ||
| Reset | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Very good! |
||
| 2.1.removing the last commit from the current branch, but the file changes will stay in the working tree. Also the changes will stay on the index. | ||
| 2.2.still keeping the changes in the working tree but not on the index. | ||
| 2.3.lose all uncommited changes and all untracked files in addition to the changes introduced in the last commit. The changes won't stay in the working tree so doing a git status command will tell you that you don't have any changes in your repository. | ||
| 2.4.it record a new commit with the changes introducted by reverting the last commit. | ||
|
|
||
| 3.the reset command sets a new HEAD position while reverting actually revert the commit specified. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file should be red since it's not in the index yet.