0% found this document useful (0 votes)
49 views7 pages

Comandos Git

The document shows the logs of a user working with Git. They are trying to add, commit and push changes to a local Git repository but are running into issues like files not being found, authentication errors when pushing, and unknown commands. They create a new file called ejercicio100.txt but then remove it from staging. In the end, they check the status again and it still shows the file as untracked.

Uploaded by

NinaBurgos
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)
49 views7 pages

Comandos Git

The document shows the logs of a user working with Git. They are trying to add, commit and push changes to a local Git repository but are running into issues like files not being found, authentication errors when pushing, and unknown commands. They create a new file called ejercicio100.txt but then remove it from staging. In the end, they check the status again and it still shows the file as untracked.

Uploaded by

NinaBurgos
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/ 7

FamiliaBenitezBurgos@FBenitezBurgos MINGW32 ~/Desktop/semana03-actividad01-VHBH

(main)
$ cd ejercicio
bash: cd: ejercicio: No such file or directory

FamiliaBenitezBurgos@FBenitezBurgos MINGW32 ~/Desktop/semana03-actividad01-VHBH


(main)
$ ejercicio2
bash: ejercicio2: command not found

FamiliaBenitezBurgos@FBenitezBurgos MINGW32 ~/Desktop/semana03-actividad01-VHBH


(main)
$ cd ejercicio2

FamiliaBenitezBurgos@FBenitezBurgos MINGW32
~/Desktop/semana03-actividad01-VHBH/ejercicio2 (main)
$ git add ejercicio02.txt
fatal: pathspec 'ejercicio02.txt' did not match any files

FamiliaBenitezBurgos@FBenitezBurgos MINGW32
~/Desktop/semana03-actividad01-VHBH/ejercicio2 (main)
$ git status
On branch main
Your branch and 'origin/main' have diverged,
and have 1 and 1 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)

Untracked files:
(use "git add <file>..." to include in what will be committed)
../bash.exe.stackdump
./
../sh.exe.stackdump

nothing added to commit but untracked files present (use "git add" to track)

FamiliaBenitezBurgos@FBenitezBurgos MINGW32
~/Desktop/semana03-actividad01-VHBH/ejercicio2 (main)
$ git status
On branch main
Your branch and 'origin/main' have diverged,
and have 1 and 1 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)

Untracked files:
(use "git add <file>..." to include in what will be committed)
../bash.exe.stackdump
./
../sh.exe.stackdump

nothing added to commit but untracked files present (use "git add" to track)

FamiliaBenitezBurgos@FBenitezBurgos MINGW32
~/Desktop/semana03-actividad01-VHBH/ejercicio2 (main)
$ git log
commit 811850fdd145de90aac1d0f7b37b7df063905920 (HEAD -> main)
Author: Victor Benitez <[email protected]>
Date: Thu Aug 5 22:09:50 2021 -0500

e agregahore: add actividad.txt

FamiliaBenitezBurgos@FBenitezBurgos MINGW32
~/Desktop/semana03-actividad01-VHBH/ejercicio2 (main)
$ git log --stat
commit 811850fdd145de90aac1d0f7b37b7df063905920 (HEAD -> main)
Author: Victor Benitez <[email protected]>
Date: Thu Aug 5 22:09:50 2021 -0500

e agregahore: add actividad.txt

actividad.txt | 0
1 file changed, 0 insertions(+), 0 deletions(-)
FamiliaBenitezBurgos@FBenitezBurgos MINGW32
~/Desktop/semana03-actividad01-VHBH/ejercicio2 (main)
$ git status
On branch main
Your branch and 'origin/main' have diverged,
and have 1 and 1 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)

Untracked files:
(use "git add <file>..." to include in what will be committed)
../bash.exe.stackdump
./
../sh.exe.stackdump

nothing added to commit but untracked files present (use "git add" to track)

FamiliaBenitezBurgos@FBenitezBurgos MINGW32
~/Desktop/semana03-actividad01-VHBH/ejercicio2 (main)
$ git add .

FamiliaBenitezBurgos@FBenitezBurgos MINGW32
~/Desktop/semana03-actividad01-VHBH/ejercicio2 (main)
$ git status
On branch main
Your branch and 'origin/main' have diverged,
and have 1 and 1 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)

Changes to be committed:
(use "git restore --staged <file>..." to unstage)
new file: ejercicio02.txt.txt

FamiliaBenitezBurgos@FBenitezBurgos MINGW32
~/Desktop/semana03-actividad01-VHBH/ejercicio2 (main)
$ git commit -m "chore:se agrego"
[main 9bddbbf] chore:se agrego
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 ejercicio2/ejercicio02.txt.txt

FamiliaBenitezBurgos@FBenitezBurgos MINGW32
~/Desktop/semana03-actividad01-VHBH/ejercicio2 (main)
$ git commit --amend
[main fbc2561] chore:se agrego
Date: Fri Aug 6 18:49:01 2021 -0500
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 ejercicio2/ejercicio02.txt.txt

FamiliaBenitezBurgos@FBenitezBurgos MINGW32
~/Desktop/semana03-actividad01-VHBH/ejercicio2 (main)
$ git log
commit fbc2561bb945bd28d49bd6e20d29c896b089a761 (HEAD -> main)
Author: Victor Benitez <[email protected]>
Date: Fri Aug 6 18:49:01 2021 -0500

chore:se agrego

commit 811850fdd145de90aac1d0f7b37b7df063905920
Author: Victor Benitez <[email protected]>
Date: Thu Aug 5 22:09:50 2021 -0500

e agregahore: add actividad.txt

FamiliaBenitezBurgos@FBenitezBurgos MINGW32
~/Desktop/semana03-actividad01-VHBH/ejercicio2 (main)
$ git commit --amend
[main 17f57c0] chore:se agrego nuevamente
Date: Fri Aug 6 18:49:01 2021 -0500
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 ejercicio2/ejercicio02.txt.txt
FamiliaBenitezBurgos@FBenitezBurgos MINGW32
~/Desktop/semana03-actividad01-VHBH/ejercicio2 (main)
$ git log
commit 17f57c0e1f025b3dc254dd96ab7bd2b072bfa095 (HEAD -> main)
Author: Victor Benitez <[email protected]>
Date: Fri Aug 6 18:49:01 2021 -0500

chore:se agrego nuevamente

commit 811850fdd145de90aac1d0f7b37b7df063905920
Author: Victor Benitez <[email protected]>
Date: Thu Aug 5 22:09:50 2021 -0500

e agregahore: add actividad.txt

FamiliaBenitezBurgos@FBenitezBurgos MINGW32
~/Desktop/semana03-actividad01-VHBH/ejercicio2 (main)
$ git push origin main
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/sena-ceet-students/semana03-
actividad01-VHBH.git/'

FamiliaBenitezBurgos@FBenitezBurgos MINGW32
~/Desktop/semana03-actividad01-VHBH/ejercicio2 (main)
$ cd ejercicio2
bash: cd: ejercicio2: No such file or directory

FamiliaBenitezBurgos@FBenitezBurgos MINGW32
~/Desktop/semana03-actividad01-VHBH/ejercicio2 (main)
$ touch ejercicio100.txt

FamiliaBenitezBurgos@FBenitezBurgos MINGW32
~/Desktop/semana03-actividad01-VHBH/ejercicio2 (main)
$ git status
On branch main
Your branch and 'origin/main' have diverged,
and have 2 and 1 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)

Untracked files:
(use "git add <file>..." to include in what will be committed)
ejercicio100.txt

nothing added to commit but untracked files present (use "git add" to track)

FamiliaBenitezBurgos@FBenitezBurgos MINGW32
~/Desktop/semana03-actividad01-VHBH/ejercicio2 (main)
$ git add .

FamiliaBenitezBurgos@FBenitezBurgos MINGW32
~/Desktop/semana03-actividad01-VHBH/ejercicio2 (main)
$ git status
On branch main
Your branch and 'origin/main' have diverged,
and have 2 and 1 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)

Changes to be committed:
(use "git restore --staged <file>..." to unstage)
new file: ejercicio100.txt

FamiliaBenitezBurgos@FBenitezBurgos MINGW32
~/Desktop/semana03-actividad01-VHBH/ejercicio2 (main)
$ git restore --staged ejercicio100.txt

FamiliaBenitezBurgos@FBenitezBurgos MINGW32
~/Desktop/semana03-actividad01-VHBH/ejercicio2 (main)
$ git status
On branch main
Your branch and 'origin/main' have diverged,
and have 2 and 1 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)

Untracked files:
(use "git add <file>..." to include in what will be committed)
ejercicio100.txt

nothing added to commit but untracked files present (use "git add" to track)

FamiliaBenitezBurgos@FBenitezBurgos MINGW32
~/Desktop/semana03-actividad01-VHBH/ejercicio2 (main)
$ git status
On branch main
Your branch and 'origin/main' have diverged,
and have 2 and 1 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)

Untracked files:
(use "git add <file>..." to include in what will be committed)
ejercicio100.txt

nothing added to commit but untracked files present (use "git add" to track)

FamiliaBenitezBurgos@FBenitezBurgos MINGW32
~/Desktop/semana03-actividad01-VHBH/ejercicio2 (main)
$ git checkout --ejercicio100.txt
error: unknown option `ejercicio100.txt'
usage: git checkout [<options>] <branch>
or: git checkout [<options>] [<branch>] -- <file>...

-b <branch> create and checkout a new branch


-B <branch> create/reset and checkout a branch
-l create reflog for new branch
--guess second guess 'git checkout <no-such-branch>' (default)
--overlay use overlay mode (default)
-q, --quiet suppress progress reporting
--recurse-submodules[=<checkout>]
control recursive updating of submodules
--progress force progress reporting
-m, --merge perform a 3-way merge with the new branch
--conflict <style> conflict style (merge or diff3)
-d, --detach detach HEAD at named commit
-t, --track set upstream info for new branch
-f, --force force checkout (throw away local modifications)
--orphan <new-branch>
new unparented branch
--overwrite-ignore update ignored files (default)
--ignore-other-worktrees
do not check if another worktree is holding the given
ref
-2, --ours checkout our version for unmerged files
-3, --theirs checkout their version for unmerged files
-p, --patch select hunks interactively
--ignore-skip-worktree-bits
do not limit pathspecs to sparse entries only
--pathspec-from-file <file>
read pathspec from file
--pathspec-file-nul with --pathspec-from-file, pathspec elements are
separated with NUL character

FamiliaBenitezBurgos@FBenitezBurgos MINGW32
~/Desktop/semana03-actividad01-VHBH/ejercicio2 (main)
$ git status
On branch main
Your branch and 'origin/main' have diverged,
and have 2 and 1 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)

Untracked files:
(use "git add <file>..." to include in what will be committed)
ejercicio100.txt
nothing added to commit but untracked files present (use "git add" to track)

FamiliaBenitezBurgos@FBenitezBurgos MINGW32
~/Desktop/semana03-actividad01-VHBH/ejercicio2 (main)
$ git add .

FamiliaBenitezBurgos@FBenitezBurgos MINGW32
~/Desktop/semana03-actividad01-VHBH/ejercicio2 (main)
$ git status
On branch main
Your branch and 'origin/main' have diverged,
and have 2 and 1 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)

Changes to be committed:
(use "git restore --staged <file>..." to unstage)
new file: ejercicio100.txt

FamiliaBenitezBurgos@FBenitezBurgos MINGW32
~/Desktop/semana03-actividad01-VHBH/ejercicio2 (main)
$ git restore --staged ejercicio100.txt
FamiliaBenitezBurgos@FBenitezBurgos MINGW32
~/Desktop/semana03-actividad01-VHBH/ejercicio2 (main)
$ git status
On branch main
Your branch and 'origin/main' have diverged,
and have 2 and 1 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)

Untracked files:
(use "git add <file>..." to include in what will be committed)
ejercicio100.txt

nothing added to commit but untracked files present (use "git add" to track)

FamiliaBenitezBurgos@FBenitezBurgos MINGW32
~/Desktop/semana03-actividad01-VHBH/ejercicio2 (main)
$

Se crea repositorio git init

Se crea archivo dentro del repositorio git touch (nombre de archivo)

Se envia el archivo al area intermedia git add (nombre del archivo)

Se realiza cambio con git commit –amend.

Se commitea git commit –m “chore: add nombre del archivo “

Se envia a repositorio con git push irigin main


GNU bash, version 4.4.20(1)-release (x86_64-pc-linux-gnu)

 cloning into https://github.com/sena-ceet-students/semana03-actividad01-VHBH...

remote: Enumerating objects: 3, done.

remote: Counting objects: 100% (3/3), done.

remote: Total 3 (delta 0), reused 3 (delta 0), pack-reused 0

From https://github.com/sena-ceet-students/semana03-actividad01-VHBH

* [new branch] main -> origin/main

HEAD branch: main

Switched to a new branch 'main'

Branch 'main' set up to track remote branch 'main' from 'origin'.

You might also like