Pro Git
Pro Git
🎯 ¿Cansado de los anuncios?
Elimínalos ahora 🚀
×
Crea tu biblioteca personal!
Si aún no tienes cuenta, registrarse es gratis y rápido. Al hacerlo, podrás guardar tus libros en tu biblioteca personal, y reanudar la lectura exactamente donde la dejaste, en cualquier dispositivo, sin descargas ni configuraciones adicionales.
Iniciar sesión o Registrarse
$ git checkout -b whitespace
Switched to a new branch 'whitespace'
$ unix2dos hello.rb
unix2dos: converting file hello.rb to DOS format ...
$ git commit -am 'converted hello.rb to DOS'
[whitespace 3270f76] converted hello.rb to DOS
1 file changed, 7 insertions(+), 7 deletions(-)
$ vim hello.rb
$ git diff -w
diff --git a/hello.rb b/hello.rb
index ac51efd..e85207e 100755
--- a/hello.rb
+++ b/hello.rb
@@ -1,7 +1,7 @@
#! /usr/bin/env ruby
def hello
- puts 'hello world'
+ puts 'hello mundo'^M
end
hello()
$ git commit -am 'hello mundo change'
[whitespace 6d338d2] hello mundo change
1 file changed, 1 insertion(+), 1 deletion(-)
Ahora volvemos a nuestra rama master y agregamos cierta documentación para la función.
$ git checkout master
Switched to branch 'master'
$ vim hello.rb
$ git diff
diff --git a/hello.rb b/hello.rb
index ac51efd..36c06c8 100755
--- a/hello.rb
+++ b/hello.rb
@@ -1,5 +1,6 @@
#! /usr/bin/env ruby
+# prints out a greeting
def hello
puts 'hello world'
end
$ git commit -am 'document the function'
[master bec6336] document the function
1 file changed, 1 insertion(+)
Ahora tratamos de fusionarnos en nuestra rama whitespace y tendremos conflictos debido a los cambios en el espacio en blanco.
👉 Descargar el audiolibro GRATIS en Amazon Reportar problema / Sugerencias