[go: up one dir, main page]

0% found this document useful (0 votes)
90 views8 pages

Git

The document provides step-by-step instructions for performing various Git commands including initializing a repository, adding and committing files, branching, merging, resolving conflicts, undoing changes, rebasing, and cloning a remote repository. It includes commands for creating branches, checking out branches, merging branches, deleting branches, adding and committing files, pulling and pushing from remote repositories, and resolving merge conflicts.

Uploaded by

John Solomon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
90 views8 pages

Git

The document provides step-by-step instructions for performing various Git commands including initializing a repository, adding and committing files, branching, merging, resolving conflicts, undoing changes, rebasing, and cloning a remote repository. It includes commands for creating branches, checking out branches, merging branches, deleting branches, adding and committing files, pulling and pushing from remote repositories, and resolving merge conflicts.

Uploaded by

John Solomon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

[10:09 PM, 7/15/2021] +918409106318: 1.

Cd test

2.git branch feature1

3.git branch feature2

4.git checkout feature1

5.open hello.py and change the text to 'hello people'

6.git add hello.py

7.git commit -m "first"

8.git checkout master

9.git merge feature1

10.git checkout feature2

11.go to hello.py and change text to 'keep playing'

12.git add hello.py

13.git commit -m "second"

14.git checkout master

15.git merge feature2

16.remove all and change the text in hello.py to 'keep playing'

17.git add hellp.py

18.git commit -m "final"

19.git branch -d feature1

20.git branch -d feature2

21.cd ../quotes

22.change the text in quotes.txt ' copy from Q till... Mahatma Gandhi'

23.git add Quotes.txt

24.git commit -m "q"

25.git pull origin master


26.git pull origin master --allow-unrelated-histories

27.git chec…

[10:09 PM, 7/15/2021] +918409106318: Working on Remote

(Git commit hands-on)

(Enter means, press enter)

1.Open the terminal

2. Type "cd test" then press enter

3. Type "git init" press enter

4. Type "git remote add origin ../.assessment/remote/" press enter

5. Type "git remote -v" press enter

6. Type "git push origin master" enter

7. Type "git add ." (dot is mandatory) enter

8. Type "git commit -m 'first' " enter

9. Type "git push origin master" enter

10. Type "cd .." (double dot mandatory) enter

11. Type "bash .clone_sh" enter

12. Type "cd test" enter

13. Type "git pull origin master" enter

14. Type "cd ../clone" enter

15. Type "git clone <given url>" enter ( don't include < >)

16. Test it. Run it.


It shows 100 % while running and testing..

Happy hands-on 🔥

[10:09 PM, 7/15/2021] +918409106318: Working on Remote

(Git commit hands-on)

(Enter means, press enter)

1.Open the terminal

2. Type "cd test" then press enter

3. Type "git init" press enter

4. Type "git remote add origin ../.assessment/remote/" press enter

5. Type "git remote -v" press enter

6. Type "git push origin master" enter

7. Type "git add ." (dot is mandatory) enter

8. Type "git commit -m 'first' " enter

9. Type "git push origin master" enter

10. Type "cd .." (double dot mandatory) enter

11. Type "bash .clone_sh" enter

12. Type "cd test" enter

13. Type "git pull origin master" enter

14. Type "cd ../clone" enter

15. Type "git clone <given url>" enter ( don't include < >)

16. Test it. Run it.


It shows 100 % while running and testing..

Happy hands-on 🔥

[10:09 PM, 7/15/2021] +918409106318: https://www.issuesolver.in/git/git-commands-working-on-


remote-rebase-conflict-undo-changes-oneline-head/

[10:09 PM, 7/15/2021] +918409106318: (Tried for Only for android 9 and above)

1. Open the file from teams in Excel or Word or Office365 app.

2. Choose the save a copy option.

3. Choose Onedrive TCS COM PROD.

4. Rename & Save the file.

5. Now open the Onedrive app.

6. In files tab there appears the saved file.

7. Open the file and edit.

8. Changes would be made automatically as it's a cloud file.

9. Now Open the Submission link provided in the Teams app through Onedrive app.

10. Choose you appropriate folder. (Say Ex: A1)

11. Choose add file or Upload Option.

12. There opens the file selector. (Android 9 or above)

13. Choose your TCS COM PROD account in the file selector.

14. Go to files folder.

15. There appears your saved(edited) file.

16. Select and Upload the file.

[10:09 PM, 7/15/2021] +918409106318: Branch n merge conflicts

cd test
git checkout -b feature1

git checkout -b feature2

git checkout feature1

vi hello.py

git add .

git commit -m 'updated'

git checkout master

git merge feature1

git checkout feature2

vi hello.py

git add .

git commit -m 'updated'

git checkout master

git merge feature2

vi hello.py

git add .

git commit -m 'updated'

vi hello.py

git branch -d feature1

git branch -d feature2

cd ..

cd quotes

vi Quotes.txt

git add .

git commit -m 'added'


git pull origin master --allow-unrelated-histories

git checkout --ours Quotes.txt

git add .

git commit -m 'added'

git push origin master

[10:09 PM, 7/15/2021] +918409106318: Undo changes

cd test

vi hello.py

git add .

git commit -m 'a'

vi hello.py

git checkout hello.py

vi hello.py

git add .

git commit --amend

git add .

git reset hello.py

vi hello.py

git add .

git log --oneline

git commit -m 'a'

git revert the_topmost_commit_no_from_the_above_command

git revert HEAD~3

[10:09 PM, 7/15/2021] +918409106318: Rebase

git clone ./assessment...


cd checkNumber

vi check_number.py

git add check_number.py

git commit -m "<message>"

git fetch origin master

git diff master origin/master

git pull --rebase origin master

vi check_number.py

>>#Read......or odd //delete everything else from <<<<<HEAD to #blue comment

git add check_number.py

git rebase --continue

git log

git push origin master

[10:09 PM, 7/15/2021] +918409106318: http://codealif.ezyro.com/category/hands-on/git/


[10:09 PM, 7/15/2021] +918409106318: http://codealif.ezyro.com/category/hands-on/git/?i=1

You might also like